This README demonstrate how to install Nvidia driver, CUDA 9.0, cuDNN 7.2 on Ubuntu 18.04 computer with iGPU and Nvidia GPU. Using the following installation --flags
, X Server is going to be running on the iGPU so that the dGPU can be used for CUDA tasks.
- Install required packages
sudo apt install build-essential libxml2 gcc-multilib dkms gcc-6 g++6 freeglut3-dev libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
- Add the following to
/etc/modprobe.d/blacklist-nouveau.conf
to disablenouveau
blacklist nouveau
options nouveau modeset=0
- Run
sudo update-initramfs -u
-
Reboot
-
Stop Desktop Manager
sudo telinit 3
- Install Nvidia Driver with
--no-opengl-files --dkms --no-drm
flags
sudo sh NVIDIA-Linux-x86_64-390.77.run --no-opengl-files --dkms --no-drm
-
Reboot
-
Comment/delete lines in
/etc/modprobe.d/blacklist-nvidia-conf
# blacklist nvidia
blacklist nvidia-drm
# blacklist nvidia-modeset
# alias nvidia off
alias nvidia-drm off
# alias nvidia-modeset off
-
Reboot
-
Install CUDA 9 with
--override
flag
sudo sh cuda_9.0.176_384.81_linux.run --override
(OPTIONAL) install related patches if desire
- Add PATH to
~/.bashrc
and/or~/.zshrc
export PATH=${PATH}:/usr/local/cuda/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
- Download and extract cuDNN 7.2.1
tar -xvf cudnn-9.0-linux-x64-v7.2.1.38.tgz
- Copy cuDNN file to
/usr/local/cuda
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*