This is my experienced guide line to install Nvidia driver.
GPU: GM107M [Geforce GTX 950M]
OS : Ubuntu 16.04
System : Lenovo ideated 700 151sk
Note : dual graphics card ( intel , nvidia )
There are three prerequisite conditions.
A> Root privilege is needed.
B> X-Server must be stopped.
C> Neuveau driver must be removed.
D> Secure boot to legacy[CSM] from Bios.
0. If you have installed nvidia graphics card driver then goto number 1 else 2.
1. Remove old graphic card dirvers.
$ sudo apt-get remove nvidia* && sudo apt-get autoremove
$ sudo nano /etc/modprobe.d/blacklist-nouveau.conf
Add the following lines and save it.
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
$ echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
$ sudo update-initramfs -u
$ reboot
This command must run on virtual terminal ( Ctrl + Alt + F1 or - F6 )
$ sudo service lightdm stop
5. Install cuda_toolkit
The latest release of the CUDA Toolkit is v8.0.(5B)
I think that v7.0 is comparably stable version. (5A)
Before doing that someone should install required packages.
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential cmake git unzip pkg-config
$ sudo apt-get install libopenblas-dev liblapack-dev
$ sudo apt-get install linux-image-generic linux-image-extra-virtual linux-source linux-headers-generic
5A. Install cuda_toolkik v7.0
5A-1. Download
CUDA Toolkit v7.0.
$ wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run
5A-2. Extract and install it.
$ chmod +x cuda_7.0.28_linux.run
$ mkdir cuda_toolkit
$ sudo ./cuda_7.0.28_linux.run -extract="this is your path"/cuda_toolkit
$ cd cuda_toolkit
$ sudo ./NVIDIA-Linux-x86_64-346.46.run
--no-opengl-libs ( this is for dual graphics card )
$ modprobe nvidia
$ sudo ./cuda-linux64-rel-7.0.28-19326674.run
$ sudo ./cuda-samples-linux-7.0.28-19326674.run
5A-3. Setting up deep learning environment.
$ nano ~/.bashrc
Add the following lines and save it.
# CUDA Toolkit v7.0
export CUDA_HOME=/usr/local/cuda-7.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
export PATH=${CUDA_HOME}/bin:${PATH}
5A-4. Let's test our installation.
$ source ~/.bashrc
$ cd /usr/local/cuda/samples/1_Utilities/deviceQuery
$ sudo make
$ ./deviceQuery
After running deviceQuery, your output should have "
Result = PASS" line.
5A-5. Clean up setup files.
$ cd "this is your cuda_toolkit path which has setup files"
$ cd ..
$ rm -rf cuda_toolkit cuda_7.0.28_linux.run
5B. Install cuda_toolkikv v8.0
5B-1. Download
CUDA toolkit v8.0
($ sudo apt-get install -y wget )
$ wget https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run
5B-2. Extract and install it
$ chmod +x cuda_8.0.44_linux-run
$ mkdir cuda_toolkit
$ sudo ./cuda_8.0.44_linux-run -extract="this is your path"/cuda_toolkit
$ cd cuda_toolkit
$ sudo ./NVIDIA-Linux-x86_64-367.48.run
--no-opengl-files ( this is for dual graphics card , usually laptop use this chipset. )
$ modprobe nvidia
$ sudo ./cuda-linux64-rel-8.0.44-21122537.run
$ sudo ./cuda-samples-linux-8.0.44-21122537.run
5B-3. Settng up following lines and save it
$ nano ~/.bashrc
Add the following lines and save it.
# CUDA Toolkit v8.0
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
export PATH=${CUDA_HOME}/bin:${PATH}
5B-4. Let's test our installation.
$ source ~/.bashrc
$ cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery
$ sudo make
$ ./deviceQuery
After running deviceQuery, your output should have "
Result = PASS" line.
5B-5. Clean up setup files.
$ cd "this is your cuda_toolkit path which has setup files"
$ cd ..
$ rm -rf cuda_8.0.44_linux.run
5C. About errors while installing.
5C-1. Secure boot problem
After run NVIDIA-Linux-x86_64-367.48.run you should see below message.
"The target kernel has CONFIG_MODULE_SIG set, which means that it supports cryptographic signatures on kernel modules. On some systems, the kernel may refuse to load modules without a valid signature from a trusted key. This system also has UEFI Secure Boot enabled; many distributions enforce module signature verification on UEFI systems when Secure Boot is enabled. Would you like to sign the NVIDIA kernel module?"
Then reboot and enter bios setup and then change your boot option.
Usually UEFI -> Legacy but some bios UEFI -> CSM.
This blogger has the same problem. (http://askubuntu.com/questions/816168/nvidia-gt730-driver-problem-with-ubuntu-16-04/841377)
5C-2. login loop problem (Can't login after Nvidia driver install)
step1> Reinstall unity in ubuntu
$ sudo su
$ apt-get update
$ apt-get install --reinstall ubuntu-desktop
$ apt-get install unity
$ reboot
step2> Reinstall graphics card driver in ubuntu
$ sudo su
$ apt-get update
$ apt-get install --reinstall ubuntu-desktop
$ apt-get install unity
$ apt-get remove --purge nvidia*
$ reboot
step3> Still do not work
$ sudo apt-get install nvidia-current
$ sudo reboot
step4> Uninstall old driver and install new one.
$ sudo apt-get remove --purge nvidia-*
<for 32bit system>
$ cd && wget us.download.nvidia.com/XFree86/Linux-x86/331.38/NVIDIA-Linux-x86-331.38.run
<for 64bit system>
$ cd && wget us.download.nvidia.com/XFree86/Linux-x86_64/331.38/NVIDIA-Linux-x86_64-331.38.run
<finally>
$ chmod +x NVIDIA-Linux-*-331.38.run
$ sudo sh NVIDIA-Linux-*-331.38.run
$ sudo reboot
This is from here (
Jiakai Zhang)
6. Install cuDNN
6-1.
Register accelerated computing developer program
6-2.
Download cuDNN (Nvidia CUDA Deep Neural Network Library)
We will use
cuDNN v5.1 Library for Linux
6-3. Extract and copy ( replacing the filename and path as necessary )
$ cd ~
$ tar -zxf cudnn-8.0-linux-x64-v5.1-tgz
$ cd cuda
$ sudo cp lib64/* /usr/local/cuda/lib64/
$ sudo cp include/* /usr/local/cuda/include/
6-4. Clean up files
$ cd ~
$ rm -rf cuda
$ rm -f cudnn-8.0-linux-x64-v5.1-tgz
댓글
댓글 쓰기