Written at the beginning: The latest version is not necessarily the best, the appropriate one is the best, cuda10.1+cudnn7.6.5 is recommended 1. Uninstall the original driver#View the installed packages apt list --installed|grep -i nvidia #Uninstall package apt-get purge nvidia* 2. Download the new graphics card driverhttps://www.nvidia.cn/Download/index.aspx?lang=cn Copy the download link and download it using wget in your system #Download wget https://cn.download.nvidia.cn/tesla/470.57.02/NVIDIA-Linux-x86_64-470.57.02.run #install sudo sh NVIDIA-Linux-x86_64-470.57.02.run 2.1 Install the graphics card driver3 Install CUDAOfficial website link Select the cuda version, which should be consistent with the driver's cuda version wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux sudo sh cuda_10.0.130_410.48_linux Add environment variables and add the suggestions in the above figure to the .bashrc file
vim ~/.bashrc #Add path export PATH=$PATH:/usr/local/cuda-11.4/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.4/lib64 #Make the environment effectivesource ~/.bashrc Check nvcc -V cudatoolkitsudo apt install nvidia-cuda-toolkit 4. Install cudnnInstall cudnn https://developer.nvidia.com/rdp/cudnn-download wget https://developer.download.nvidia.cn/compute/machine-learning/cudnn/secure/8.2.2/11.4_07062021/Ubuntu18_04-x64/libcudnn8_8.2.2.26-1%2Bcuda11.4_amd64.deb?aJLLhXbzztwE4iizwf68uvg1s73kk4KKBGqv6B0UkO9HhnOhOsGHlyo1Br5CWc0nAIJLmc6C5SkLYqbdQqdZBoAdcVQgBTmWKXJXigR7roUeXd0VIKUuM57UKWMp3BUQgr6SQ4kkGnRRtUJ5mJt dpkg -i libcudnn8_8.2.2.26-1+cuda11.4_amd64.deb 5. Install anacondawget https://mirror.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.05-Linux-x86_64.sh Add environment variablesvim ~/.bashrc export PATH="/usr/local/anaconda3/bin:$PATH" source ~/.bashrc Replace anaconda source"""Change Tsinghua conda source""" conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --set show_channel_urls yes conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ Check the tensorflow version pip install tensorflow-gpu==2.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple Test the installed tensorflowimport tensorflow as tf print(tf.test.is_gpu_available()) tf.__version__ tf.__path__ The reason for the above error is that the cuda version is too high. You need to choose version 10.1 The reason for the above error is that the cudnn version is too high. You need to choose version 7.6.5 The default Python2 is changed to Python3 apt-get install python3.7 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150 sudo apt install python3-pip The above is the detailed content of the tutorial on installing graphics driver and cuda in Ubuntu. For more information about installing graphics driver and cuda in Ubuntu, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Detailed explanation of :key in VUE v-for
>>: A brief discussion on Flex layout and scaling calculation
Preface I recently used a virtual machine to inst...
Table of contents 1. Data Manipulation Language (...
Hello everyone, I am Tony, a teacher who only tal...
Table of contents The first method: router-link (...
The first step is to prepare an icon making softwa...
Why can it set the height, but unlike elements lik...
I have been taking a lot of MySQL notes recently,...
Canal is an open source project under Alibaba, de...
I am currently developing a new app project. This...
As users become more privacy-conscious and take m...
Without further ado, let’s get straight to the co...
Table of contents 1. Error message 2. Cause of er...
Nginx does not support nested if statements, nor ...
Table of contents Overview Example Why is it need...
Table of contents 1. Template 2. Generics 3. Gene...