Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install NVIDIA offical/CUDA driver on CentOS 7.2
09-04-2017, 10:55 AM (This post was last modified: 09-11-2017 03:42 PM by xwcwt.)
Post: #1
Install NVIDIA offical/CUDA driver on CentOS 7.2
There's a open-source VGA driver for NVIDIA 'nouveau' is integrated into the kernel module in default, in order to install nvidia offical driver, need black the open-source one first then install.

Requirement:
kernel-devel, kernel-headers and gcc package is need. yum install first if any is not exist.

1. black nouveau

edit /etc/modprobe.d/blacklist.conf and add
"
blacklist nouveau
options nouveau modeset=0
"
into the file.

2. re-generate the initramfs without nouveau
Code:
cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).nouveau.img

Code:
dracut --omit-drivers "nouveau" /boot/initramfs-$(uname -r).img $(uname -r) --force

Code:
reboot
then restart the OS.

3. install the official/CUDA driver

the CUDA driver refer http://tab.d-thinker.org/showthread.php?...http://tab.d-thinker.org/showthread.php?tid=9289&pid=4946

download the driver from http://www.geforce.cn/drivers , its name will be like NVDIA-Linux..., there's assume the name is nvidia.run. there also assume the kernel source file is in /usr/src/kernels/4.9.13-22.el7.x86_64. then the command is
Code:
./nvidia.run --kernel-source-path='/usr/src/kernels/4.9.13-22.el7.x86_64/'

choose 'Accept' then Yes to install the driver.

4.Verify the driver
after reboot the OS, use
Code:
lsmod | grep 'nouveau'
to see if this has been blacked and
Code:
lsmod| grep -i nvidia
to see if there's nvidia module is running.
Find all posts by this user
Quote this message in a reply
09-04-2017, 02:48 PM (This post was last modified: 09-04-2017 02:48 PM by xwcwt.)
Post: #2
RE: Install NVIDIA offical driver on CentOS 7.2
perform
Code:
nvidia-xconfig
as root will generate a new xorg.conf with nvidia driver.
Find all posts by this user
Quote this message in a reply
09-11-2017, 03:41 PM (This post was last modified: 09-11-2017 03:50 PM by xwcwt.)
Post: #3
RE: Install NVIDIA offical driver on CentOS 7.2
the CUDA driver installation is similar with the above driver, just as step3 to install the CUDA driver download from https://developer.nvidia.com/cuda-downloads . Also install the CUDA driver will also install the NVIDIA official driver together, so there's no need to install the official driver first.

the command requirement is "libXmu-devel libXi-devel libX11-devel libGLU-devel" are needed(can be installed by yum).

Assume the CUDA driver is cuda.run, perform
Code:
./cuda.run --kernel-source-path='/usr/src/kernels/4.9.13-22.el7.x86_64/'

to install the driver. Genrally type 'q' then type 'accept' to start the installation. Also, use default choice is good enough.

if choose install the sample when install the driver and assume installed into ~/cuda/ , then user can enter ~/cuda/NVIDIA_CUDA-8.0_Samples/0_Simple/asyncAPI/ then run make. if it an be compiled successfully, then run the binary file to test if the driver works or not.

the driver's last output can be treated as a reference:
"
Please make sure that
- PATH includes /usr/local/cuda-8.0/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64, or, add /usr/local/cuda-8.0/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-8.0/doc/pdf for detailed information on setting up CUDA.
"
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: