Intro

I am experimenting with local AI tools and want to use my desktop PC as an Ubuntu server for running experiments and labs. This is just a quick post to document the steps to install the Nvidia drivers on an Ubuntu 2404 minimal server.

Software Versions

The following software versions were used in this post.

  • Nvidia Drivers - Server 550
  • Ubuntu Server - 2404.1

Install

This article has a good rundown of the options and I suggest reading it before proceeding.

Install the required packages.

cmd
sudo ubuntu-drivers --gpgpu install nvidia:550-server
sudo apt install -y nvidia-utils-550-server
sudo apt install -y nvidia-driver-550
sudo apt install -y libnvidia-ml-dev

Verify

Verify that the GPU is detected.

cmd
nvidia-smi

# Output
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.120                Driver Version: 550.120        CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2060 ...    Off |   00000000:01:00.0 Off |                  N/A |
|  0%   45C    P8             14W /  184W |       4MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

For bonus points, if you use BTOP, you can view the GPU usage by pressing 5 on the keyboard.

Troubleshoot

If the GPU is not detected, use these further troubleshooting commands to help narrow down the problem.

Check which packages are installed.

cmd
lsmod | grep nvidia

# Output
ii  libnvidia-cfg1-550:amd64                  550.120-0ubuntu0.24.04.1                   amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-550                      550.120-0ubuntu0.24.04.1                   all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-550:amd64               550.120-0ubuntu0.24.04.1                   amd64        NVIDIA libcompute package
rc  libnvidia-compute-550-server:amd64        550.127.08-0ubuntu0.24.04.1                amd64        NVIDIA libcompute package
ii  libnvidia-decode-550:amd64                550.120-0ubuntu0.24.04.1                   amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-egl-wayland1:amd64              1:1.1.13-1build1                           amd64        Wayland EGL External Platform library -- shared library
ii  libnvidia-encode-550:amd64                550.120-0ubuntu0.24.04.1                   amd64        NVENC Video Encoding runtime library
ii  libnvidia-extra-550:amd64                 550.120-0ubuntu0.24.04.1                   amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-550:amd64                  550.120-0ubuntu0.24.04.1                   amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-550:amd64                    550.120-0ubuntu0.24.04.1                   amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ml-dev:amd64                    12.0.140~12.0.1-4build4                    amd64        NVIDIA Management Library (NVML) development files
ii  linux-modules-nvidia-550-6.8.0-51-generic 6.8.0-51.52+1                              amd64        Linux kernel nvidia modules for version 6.8.0-51
ii  linux-modules-nvidia-550-generic          6.8.0-51.52+1                              amd64        Extra drivers for nvidia-550 for the generic flavour
ii  linux-objects-nvidia-550-6.8.0-51-generic 6.8.0-51.52+1                              amd64        Linux kernel nvidia modules for version 6.8.0-51 (objects)
ii  linux-signatures-nvidia-6.8.0-51-generic  6.8.0-51.52+1                              amd64        Linux kernel signatures for nvidia modules for version 6.8.0-51-generic
ii  nvidia-compute-utils-550                  550.120-0ubuntu0.24.04.1                   amd64        NVIDIA compute utilities
ii  nvidia-cuda-dev:amd64                     12.0.146~12.0.1-4build4                    amd64        NVIDIA CUDA development files
ii  nvidia-cuda-gdb                           12.0.140~12.0.1-4build4                    amd64        NVIDIA CUDA Debugger (GDB)
ii  nvidia-cuda-toolkit                       12.0.140~12.0.1-4build4                    amd64        NVIDIA CUDA development toolkit
ii  nvidia-cuda-toolkit-doc                   12.0.1-4build4                             all          NVIDIA CUDA and OpenCL documentation
ii  nvidia-driver-550                         550.120-0ubuntu0.24.04.1                   amd64        NVIDIA driver metapackage
ii  nvidia-firmware-550-550.120               550.120-0ubuntu0.24.04.1                   amd64        Firmware files used by the kernel module
ii  nvidia-kernel-common-550                  550.120-0ubuntu0.24.04.1                   amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-550                  550.120-0ubuntu0.24.04.1                   amd64        NVIDIA kernel source package
ii  nvidia-opencl-dev:amd64                   12.0.140~12.0.1-4build4                    amd64        NVIDIA OpenCL development files
ii  nvidia-prime                              0.8.17.2                                   all          Tools to enable NVIDIAs Prime
ii  nvidia-profiler                           12.0.146~12.0.1-4build4                    amd64        NVIDIA Profiler for CUDA and OpenCL
ii  nvidia-settings                           510.47.03-0ubuntu4                         amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-550                          550.120-0ubuntu0.24.04.1                   amd64        NVIDIA driver support binaries
ii  nvidia-visual-profiler                    12.0.146~12.0.1-4build4                    amd64        NVIDIA Visual Profiler for CUDA and OpenCL
ii  screen-resolution-extra                   0.18.3                                     all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-550             550.120-0ubuntu0.24.04.1                   amd64        NVIDIA binary Xorg driver

Check the kernel modules that are loaded.

cmd
lsmod | grep nvidia

# Output
nvidia_uvm           4972544  2
nvidia_drm            122880  0
nvidia_modeset       1355776  1 nvidia_drm
nvidia              54308864  7 nvidia_uvm,nvidia_modeset
i2c_nvidia_gpu         12288  0
i2c_ccgx_ucsi          12288  1 i2c_nvidia_gpu
video                  73728  2 asus_wmi,nvidia_modeset

Check the driver version.

cmd
cat /proc/driver/nvidia/version

# Output
NVRM version: NVIDIA UNIX x86_64 Kernel Module  550.120  Fri Sep 13 10:10:01 UTC 2024
GCC version:

Outro

There are some very interesting AI tools that can be run locally.