Site Tools


staff-wiki:linux_cuda

CUDA Drivers

CentOS 7

The installation of CUDA drivers on CentOS has been simplified by an install script designed to take care all steps automatically. To install CUDA drivers on a CentOS system, run the following script /sw/pkgs/scripts/cuda-9.0.sh:

ktm5j@qcuda2 /sw/pkgs/scripts $ sudo /sw/pkgs/scripts/cuda-9.0.sh 
[sudo] password for ktm5j: 
Writing grub config..			done
Creating systemd service..		done
Writing install script..		done
Copying installed to local disk..	done
Activating systemd service..		done

Script has completed successfully.  Press enter to reboot now or ctrl-c to exit

After the script completes we just need to reboot and we are done.

Manual Process

The nVidia driver installer will not allow you to install the drivers if you are running the generic opens source nouveau. This means that before we can install the CUDA drivers on CentOS, we first need to blacklist those modules.

Add the following to GRUB_CMDLINE_LINUX in /etc/default/grub:

rd.driver.blacklist=nouveau nouveau.modeset=0

and run

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Then reboot the system

After rebooting run the driver installer located in

/sw/pkgs/cuda_9.0.176_384.81_linux-run

Follow this process

ktm5j@qcuda5 ~ $ sudo /sw/pkgs/cuda_9.0.176_384.81_linux-run 
Logging to /tmp/cuda_install_3994.log
Using more to view the EULA.
End User License Agreement
--------------------------

...
EULA shown here, scroll to the bottom or press 'q' to exit EULA and continue
...

Do you accept the previously read EULA?
accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
(y)es/(n)o/(q)uit: yes

Do you want to install the OpenGL libraries?
(y)es/(n)o/(q)uit [ default is yes ]: yes

Do you want to run nvidia-xconfig?
This will update the system X configuration file so that the NVIDIA X driver
is used. The pre-existing X configuration file will be backed up.
This option should not be used on systems that require a custom
X configuration, such as systems with multiple GPU vendors.
(y)es/(n)o/(q)uit [ default is no ]: yes

Install the CUDA 9.0 Toolkit?
(y)es/(n)o/(q)uit: no

Install the CUDA 9.0 Samples?
(y)es/(n)o/(q)uit: no

Installing the NVIDIA display driver...

===========
= Summary =
===========

Driver:   Installed
Toolkit:  Not Selected
Samples:  Not Selected

To uninstall the NVIDIA Driver, run nvidia-uninstall

Logfile is /tmp/cuda_install_3994.log

If the installation fails, usually due to an incomplete library error, try this on Ubuntu:

# apt purge nvidia*

or this on CentOS:

# sudo /sw/pkgs/cuda_9.0.176_384.81_linux-run --silent --uninstall

Then retry the installation script.

Then run nvidia-smi to verify the installation

ktm5j@qcuda5 ~ $ nvidia-smi

Do not install the Toolkit or Samples. The toolkit is available through Modules.

staff-wiki/linux_cuda.txt · Last modified: 2023/08/29 19:56 by 127.0.0.1