Driver Installation#

Attention

The NVIDIA GPU and NIC drivers only need to be installed to allow both native Ubuntu software development and containerized work on the same machine. See Verify Installed Drivers for more information.

Install DOCA-OFED Driver#

  1. Download the DOCA host repo for your platform from the NVIDIA DOCA Downloads page.

    Download page for DOCA
  2. Unpack the deb repo:

    sudo dpkg -i <repo_file>
    
  3. Run apt update:

    sudo apt-get update
    
  4. If the kernel version on your host is not supported (that is, not listed under the section Supported Host OS per DOCA-Host Installation Profile), refer to the section DOCA Extra Package and doca-kernel-support.

  5. Ensure that the kernel headers installed match the version of the currently running kernel.

    Note

    If the build directory exists in under /lib/modules/$(uname -r)/build, then the kernel headers are installed.

  6. Install doca-ofed:

    sudo apt install -y doca-ofed mlnx-fw-updater
    
  7. Load the driver:

    sudo /etc/init.d/openibd restart
    

Install the NVIDIA GPU Driver#

  1. Check the available NVIDIA GPU drivers for your system.

    sudo ubuntu-drivers list
    
  2. To install the driver, run:

    sudo apt install nvidia-driver-580
    
  3. Restart the system:

    sudo reboot
    

Load nvidia-peermem Module#

Load the nvidia-peermem module:

sudo modprobe nvidia-peermem
echo "nvidia-peermem" | sudo tee /etc/modules-load.d/nvidia-peermem.conf

Driver Uninstallation#

Uninstalling DOCA-OFED Driver#

  1. Remove DOCA and related packages:

    for f in $( dpkg --list | grep -E 'doca|flexio|dpa-gdbserver|dpa-stats|dpaeumgmt' | awk '{print $2}' ); do echo $f ; sudo apt remove --purge $f -y ; done
    sudo /usr/sbin/ofed_uninstall.sh --force
    sudo apt-get autoremove
    
  2. Uninstall OFED driver:

    sudo /usr/sbin/ofed_uninstall.sh --force
    
  3. Clean up remaining dependencies:

    sudo apt autoremove
    

Uninstalling the NVIDIA GPU Driver#

  1. Determine the driver branch:

    export DRIVER_BRANCH=$(nvidia-smi --query-gpu=driver_version --format=csv,noheader | head -n1 | cut -d. -f1)
    
  2. Remove GPU driver from your system:

    sudo apt --purge remove "*nvidia*${DRIVER_BRANCH}*"
    
  3. Clean up remaining dependencies and restart the system:

    sudo apt autoremove
    sudo reboot
    

Note

For more details refer to the NVIDIA and Ubuntu drivers documentation.