Skip to main content
Install drivers on a cloud server with a GPU
Last update:

Install drivers on a cloud server with a GPU

In order for NVIDIA® GPUs to work consistently on cloud server with GPU, drivers must be installed. The drivers are pre-installed in servers created from an off-the-shelf Ubuntu 22.04 LTS Machine Learning 64-bit image.

  1. Select driver version.
  2. Install driver.

1. Select the driver version

  1. Connect to cloud server with GPU.

  2. Install the ubuntu-drivers-common package:

    sudo apt install -y ubuntu-drivers-common alsa-utils
  3. Check the recommended driver version:

    sudo ubuntu-drivers devices

    A list of versions will appear in the response. Example for NVIDIA® Tesla T4 GPU with recommended version 550:

    == /sys/devices/pci0000:00/0000:00:06.0 ==
    modalias : pci:v000010DEd00001EB8sv000010DEsd000012A2bc03sc02i00
    vendor : NVIDIA Corporation
    model : TU104GL [Tesla T4]
    manual_install : True
    driver : nvidia-driver-450-server - distro non-free
    driver : nvidia-driver-535-server - distro non-free
    driver : nvidia-driver-470-server - distro non-free
    driver : nvidia-driver-470 - distro non-free
    driver : nvidia-driver-550 - third-party non-free recommended
    driver : nvidia-driver-418-server - distro non-free
    driver : xserver-xorg-video-nouveau - distro free builtin
  4. optional: see the list of all available versions:

    sudo apt-cache search nvidia-driver-*

    Make sure that the selected driver version is higher than the minimum compatible version for the GPU architecture of the cloud server. To see the GPU architecture, see the Create a cloud server with GPU instructions, and to see if the driver version and architecture match, see the CUDA Compatibility instructions in the NVIDIA® documentation.

2. Install the driver

  1. If the GPU architecture is Pascal (for example, NVIDIA® GTX 1080), add the NVIDIA® Personal Package Archive repository to the cloud server:

    sudo add-apt-repository ppa:graphics-drivers/ppa -y
  2. Install linux-headers (kernel headers):

    sudo apt update
    for kernel in $(linux-version list); do apt install -y \"linux-headers-${kernel}\"; done
  3. Install the driver:

    sudo apt install -y nvidia-driver-<driver_version>

    Specify <driver_version> — the driver version you chose.

    Example of installing the recommended version 550 for NVIDIA® Tesla T4 GPUs:

    sudo apt install -y nvidia-driver-550
  4. Verify that the driver is installed and working:

    nvidia-smi

    NVIDIA-SMI, driver and CUDA versions will appear in the response. For example:

    +-----------------------------------------------------------------------------------------+
    | NVIDIA-SMI 550.54.15 Driver Version: 550.54.15 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. |
    | | | MIG M. |
    |=========================================+========================+======================|
    | 0 Tesla T4 Off | 00000000:00:06.0 Off | 0 | 0 | 0 |
    | N/A 41C P8 10W / 70W | 0MiB / 15360MiB | 0% Default |
    | | | N/A |
    +-----------------------------------------+------------------------+----------------------+

    +-----------------------------------------------------------------------------------------+
    | Processes: |
    | GPU GI CI PID Type Process name GPU Memory |
    | ID ID Usage |
    |=========================================================================================|
    | No running processes found |
    +-----------------------------------------------------------------------------------------+
  5. Open the configuration file of the unattended-upgrades package that handles security updates:

    nano /etc/apt/apt.conf.d/50unattended-upgrades
  6. Prohibit package updates for NVIDIA®. To do this, add a block to the file:

    Unattended-Upgrade::Package-Blacklist {
    "linux-";
    "nvidia-";
    };