Detaylı Türkçe anlatım --> Medium - Emre YESILYURT
- Installing Cuda 10.1.
- Installing cuDNN v7.6.5
- Adding the cuda environment variables to the bash profile.
- Installing Tensorflow.
If you see the "Continue using a manually installed driver" warning, you must uninstall the manually installed driver's repo.
$ sudo nano /etc/apt/sources.list
Then remove the repo.
$ sudo apt update
Reboot
$ reboot
sudo apt install nvidia-cuda-toolkit
nvcc -V
To download cuDNN we must have an nvidia account. From this link, you can go to the page where you can download cuDNN, after logging in, you can download cuDNN.
Let's download the compatible cuDNN v7.6.5 for CUDA 10.1 version.
Then in the directory where we downloaded cuDNN;
$ tar -xvzf cudnn-10.1-linux-x64-v7.6.5.32.tgz
Then we copy the extracted files to the directory where the cuda is installed.
$ sudo cp cuda/include/cudnn.h /usr/lib/cuda/include/
$ sudo cp cuda/lib64/libcudnn* /usr/lib/cuda/lib64/
Set file permissions.
$ sudo chmod a+r /usr/lib/cuda/include/cudnn.h /usr/lib/cuda/lib64/libcudnn*
Adding cuda environment variables to the bash profile.
$ nano ~/.bashrc
Add the following lines at the end of the lines.
export LD_LIBRARY_PATH=/usr/lib/cuda/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/cuda/include:$LD_LIBRARY_PATH
Rerun the bash profile.
source ~/.bashrc
Installing TensorFlow
$ pip3 install tensorflow
Check that everything is fine.
import tensorflow as tf
tf.config.list_physical_devices("GPU")