-
Notifications
You must be signed in to change notification settings - Fork 0
GPU
Refer to link. It looks as though the CUDA 9.1 is actually in the official 18.04 repositories now. Run the following from a terminal window:
$ sudo apt install nvidia-cuda-toolkit
After it is installed run the following to confirm the CUDA version
$ nvcc -V
First download the driver from the NVIDIA website (e.g. NVIDIA-Linux-x86_64-340.87.run), then shut down the X server by
$ sudo service lightdm stop
then start running the driver installation
$ sudo ./NVIDIA-Linux-x86_64-340.87.run
$ sudo apt-add-repository ppa:xorg-edgers/ppa
To revert to official packages
$ sudo ppa-purge xorg-edgers
or refer to this link
$ sudo apt-get install nvidia-340
$ sudo apt-cache search nvidia-cuda
$ sudo apt-get install nvidia-cuda-toolkit
The nvidia driver is a kernel driver, that needs to be compiled/linked against each kernel. If we update the linux kernel, the nvidia driver needs to be recompiled, from source. dkms is 'dynamic kernel module support'. dkms handles recompiling any such drivers, including the nvidia driver, automatically, whenever the kernel is updated. So we just install dkms
$ sudo apt-get install dkms
First download the runfile from https://developer.nvidia.com/cuda-downloads, then do
$ sudo service lightdm stop
$ sudo sh cuda_8.0.44_linux.run
then download cuDNN from https://developer.nvidia.com/cudnn and do
$ tar xvzf cudnn-8.0-linux-x64-v5.1.tgz
$ sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
then we add the following lines in the ~/.bash_profile
#CUDA
export CUDA_HOME=/usr/local/cuda
export PATH="$CUDA_HOME/bin:$PATH"
export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
finally we do
$ pip install tensorflow
or
$ pip install tensorflow-gpu
for the GPU support.