Disabling Nouveau, if required (login loop or low res mode), otherwise skip to next section
- Confirm nouveau is loaded
lsmod | grep -i nouveau
You’ll see the text nouveau in the 4th column, if loaded
video XXXX Y nouveau
- If nouveau is loaded then blacklist it. Create the file
blacklist-nouveau.conf
in/etc/modprobe.d/
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
And add the following text
blacklist nouveau
options nouveau modeset=0
Execute
sudo update-initramfs -u
Restart
NVIDIA Driver Setup
Download the RUN file from NVidia’s website https://www.geforce.com/drivers You’ll have a file named similarly to
NVIDIA-Linux-x86_64-XXX.YY.run
Assign execution permissions
chmod +x NVIDIA-Linux-x86_64-XXX.YY.run
Move to a virtual console pressing
Ctrl+Alt+F1
and loginTerminate the X Server executing
sudo service lightdm stop
Run the installer
sudo ./NVIDIA-Linux-x86_64-XXX.YY.run
(If you are running on a laptop run insteadsudo ./NVIDIA-Linux-x86_64-XXX.YY.run --no-opengl-files
)Follow the instruction from the wizard. At the end, do not allow the wizard to modify the X configuration.
Once back in the console, execute
sudo service lightdm start
. The GUI should be displayed. Login.To confirm everything is set run in a terminal
nvidia-smi
CUDA Setup
Download the CUDA Installation RUN File from https://developer.nvidia.com/cuda-downloads You’ll have a file named similarly to
cuda_X.0.YY.Z_linux.run
Assign execution permissions
chmod +x cuda_X.0.YY.Z_linux.run
Run the installer
sudo ./cuda_X.0.YY.Z_linux.run
Follow the instructions on screen. DO NOT install the NVIDIA Driver included. Install the CUDA Samples on your home directory.
Once finished, to confirm everything is ok. Go to your home directory and execute
cd NVIDIA_CUDA-X.Y_Samples/1_Utilities/deviceQuery
Match X, Y to your CUDA version. i.e. CUDA 9.0cd NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQuery
Compile the sample running
make
Run the sample
./deviceQuery
you should see the details about your GPU(s) and CUDA Setup.