Nvidia on Ubuntu

From Freephile Wiki
Revision as of 10:07, 26 June 2025 by Admin (talk | contribs)

Because I wanted to run a local Artificial Intelligence platform called Ollama, I wanted to ensure that my GPU was fully utilized in the system since GPUs are the particular type of hardware best suited for these Vector calculations. And, I have a 'decent' GPU - Nvidia GeForce RTX 4060 (the best you could get at the time). In trying to install the latest Nvidia driver, I set off on a week's long journey of learning, frustration and perseverance discovering the inner workings of Ubuntu 24.04, Xorg, the Linux kernel and kernel modules, DRM, Secure Boot, initramfs and more.

I still do not have the Nvidia driver loaded - even after 40+ reboots and attempts. Instead I'm using the Nouveau driver but at least I have a working system and I believe now that I've finally figured out what needs to be done to disable Nouveau and install Nvidia - a project that I might tackle shortly. I'm just documenting the things that I encountered in this journey so that I can pick it back up at the right time.

X.org[edit]

Here is the Xorg.log file from my first boot into a clean system having no Nvidia drivers.

The XServer is loading the nouveau driver package "xserver-xorg-video-nouveau".

This driver for the X.Org X server (see xserver-xorg for a further description) provides support for NVIDIA Riva, TNT, GeForce, and Quadro cards.

This package provides 2D support including EXA acceleration, Xv and RandR. 3D functionality is provided by the libgl1-mesa-dri package.

This package is built from the FreeDesktop.org xf86-video-nouveau driver.

dpkg -l | grep -i nouveau

ii  libdrm-nouveau2:amd64                                    2.4.122-1~ubuntu0.24.04.1                     amd64        Userspace interface to nouveau-specific kernel DRM services -- runtime

ii  xserver-xorg-video-nouveau                               1:1.0.17-2build1                              amd64        X.Org X server -- Nouveau display driver


lsmod | grep nouveau

nouveau              3096576  68
drm_gpuvm              45056  2 xe,nouveau
drm_exec               12288  3 drm_gpuvm,xe,nouveau
gpu_sched              61440  2 xe,nouveau
drm_ttm_helper         12288  2 xe,nouveau
ttm                   110592  4 drm_ttm_helper,xe,i915,nouveau
drm_display_helper    237568  3 xe,i915,nouveau
mxm_wmi                12288  1 nouveau
i2c_algo_bit           16384  3 xe,i915,nouveau
video                  77824  3 xe,i915,nouveau
wmi                    28672  4 video,wmi_bmof,mxm_wmi,nouveau