Installing an NVIDIA Driver on a Linux VM
This page describes how to install an NVIDIA driver for supported GPUs, on a Linux CentOS 7 virtual machine (VM).
A VM can be equipped with a GPU by using some specific VM types, or by attaching a flexible GPU. For more information, see VM Types or About Flexible GPUs.
Installing the NVIDIA Driver for K2
-
On the VM, check that the GPU is present:
$ yum install -y pciutils $ lspci
-
Update your packages and dependencies:
$ yum update -y # /!\ Reboot if there is a kernel update $ yum install -y epel-release kernel-devel
-
Disable the Nouveau default driver:
$ echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf $ echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf $ rmmod nouveau
-
Install CUDA Toolkit 8.0:
$ yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo $ yum clean all $ yum -y install cuda-8-0
-
The last NVIDIA driver compatible with K2 is version 367.134, but you must patch it for it to work on the CentOS 7 kernel:
$ curl 'https://us.download.nvidia.com/XFree86/Linux-x86_64/367.134/NVIDIA-Linux-x86_64-367.134.run' -o NVIDIA-Linux-x86_64-367.134.run $ sh NVIDIA-Linux-x86_64-367.134.run -x $ cd NVIDIA-Linux-x86_64-367.134 $ echo "H4sIAL3q8V4AA81WbW/aMBD+vPwKT5UmKARIwnvVqRkxbdS8IBOo9smixLRZIUFOYJ3W/vedCbBIayntqDYL4sS+53KP/fgufjCZINkZLTgq8yhKys7QNExdtoJwcS/fN+u0XpW1eqOkaNXyHeMhm5bDZeAHI9nns8wt/JelMSovYl6O+Xgzs4HuwEiyLB/k5R/UitKSFVVWGkjR2lq9rSilyqahgrhKhULhLUGCb7UiV+qyqiJFaatau1YpaZpW05SG0lz7PjtDcq2lFlV42bo/O5PQUTBBPpsEIfNzzpAaxKa659pmh9qugfvYo/pQNy39i4XzEhJNmJhux7OogbsAGObSlaHnGCbsnks86gwv7T61se2Sr8UU9mdLaVCgQW/YjAazecQTGi7vZjGdsVnEfxQl+WmoiKHjOh5xLapblnv1IEYGjuV2LrGRL0qF53EZq918dMNYE+l+2YfEyPfX0U+u/23ktnlOdA9vt9C9cjDpX5i9fWjMghs+ShidRT6LWUKj7yHj8W0w38nJ1vseJg9/Qy/jIsv0iIU+iLR8jF7QJzou76/QQR9WpKd38NtUuohhTeajMXubUgl2DExevUK7YC8x92BoSE2n6+5HNaE+W9IgnET/AbfHEwlJKE5GSTCGji/GCRJh+jxYMg6B08zTKfop+QcrHbDpry4dK8whSsfK0TuVjo3v36VDbavNdq1VqmqKqirVViVTOhrVYgMVVldRNjaNs2TBQ4QJoT2P5OAxf5LOPsKOrXSzOTnR9Tc2hpMTcjZhnIVwdhbhNBrfQeX5BDsINvLn61HMwEPhCeB8kTwPQNJaweno7Sj0pwyUcJzeCQPBolqtCRppJ3hIyI9C1k7RkGVyAEcfT5EzsKw86Gir/H1YwPwm9pfiT023C5VdS+hODqjfORyK0u0rtZGCDqHg1NM7SXjrPKthDX6tUkXTVE1ptloZDddVsfmr6zOfPiJFDhwCubNHoLg43uqb5yi1QhmjLsE4R0WKzKeJCHLlShPrQVG2pjET+tkTPeGMbcCFvVEgqswbRaEUanqC2QW2epBeRdGkXdOy4JuG9j0y6Hj0Qu+LNN730tmObVCdnOelXzvAfRF/CwAA" | base64 --decode | gzip -d > nvidia-k2.patch $ patch -p3 < nvidia-k2.patch $ ./nvidia-installer -q -s -a
To check that the
nvidia*
modules are present on the VM, type:$ lsmod
Installing the NVIDIA Driver for P6 or P100
To install the required CUDA Toolkit 11.0 on a VM that uses the official CentOS 7 OUTSCALE machine image, you need to start your VM with a root volume that is at least 1 GiB larger than the default 10 GiB. |
-
On the VM, check that the GPU is present:
$ yum install -y pciutils $ lspci
-
Update your packages and dependencies:
$ yum update -y # /!\ Reboot if there is a kernel update $ yum install -y pciutils epel-release kernel-devel
-
Disable the Nouveau default driver:
$ echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf $ echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf $ rmmod nouveau
-
Install CUDA Toolkit 11.0 and the latest NVIDIA driver:
$ yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo $ yum clean all $ yum -y install nvidia-driver-latest-dkms cuda-11-0 $ /sbin/dkms build -m nvidia -v $(rpm -qa kmod-nvidia-latest-dkms | cut -d '-' -f 5) -k $(uname -r) $ /sbin/dkms install -m nvidia -v $(rpm -qa kmod-nvidia-latest-dkms | cut -d '-' -f 5) -k $(uname -r)
To check that the
nvidia*
modules are present on the VM, type:$ lsmod