Driver Installation#

Attention

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

Install the DOCA-OFED Driver#

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

    Download page for DOCA
  2. Install the repository package:

    sudo dpkg -i <repo_file>
    
  3. Update the package index:

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

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

    Note

    If the /lib/modules/$(uname -r)/build directory exists, 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. List the available NVIDIA GPU drivers for your system:

    sudo ubuntu-drivers list
    
  2. Install the driver:

    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 the 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 the 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 information, refer to the following NVIDIA and Ubuntu driver documentation: