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#
Download the DOCA host repo for your platform from the NVIDIA DOCA Downloads page.
Unpack the deb repo:
sudo dpkg -i <repo_file>
Run apt update:
sudo apt-get update
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.
Ensure that the kernel headers installed match the version of the currently running kernel.
Note
If the
builddirectory exists in under/lib/modules/$(uname -r)/build, then the kernel headers are installed.Install
doca-ofed:sudo apt install -y doca-ofed mlnx-fw-updater
Load the driver:
sudo /etc/init.d/openibd restart
Install the NVIDIA GPU Driver#
Check the available NVIDIA GPU drivers for your system.
sudo ubuntu-drivers list
To install the driver, run:
sudo apt install nvidia-driver-580
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#
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
Uninstall OFED driver:
sudo /usr/sbin/ofed_uninstall.sh --force
Clean up remaining dependencies:
sudo apt autoremove
Uninstalling the NVIDIA GPU Driver#
Determine the driver branch:
export DRIVER_BRANCH=$(nvidia-smi --query-gpu=driver_version --format=csv,noheader | head -n1 | cut -d. -f1)
Remove GPU driver from your system:
sudo apt --purge remove "*nvidia*${DRIVER_BRANCH}*"
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.