作者:okkkokkokkkokka | 来源:互联网 | 2023-09-23 16:18
cuda和显卡驱动的版本对应关系安装cuda在服务中已经安装好了cuda10.0,现在需要安装cuda10.1chmodxcuda_10.1.105_418.39
cuda和显卡驱动的版本对应关系
安装cuda
在服务中已经安装好了cuda10.0,现在需要安装cuda10.1
chmod +x cuda_10.1.105_418.39_linux.run
sudo ./cuda_10.1.105_418.39_linux.run
1. 第一步
Do you accept the above EULA? (accept/decline/quit): xaccept
2. 选择安装
x CUDA Installer se Agreement x
x - [ ] Driver x
x [ ] 418.39 x
x + [X] CUDA Toolkit 10.1 x
x [ ] CUDA Samples 10.1 x
x [ ] CUDA Demo Suite 10.1 x
x [ ] CUDA Documentation 10.1 x
x Install x
x Options
注意:显卡驱动可以不用安装,因为我之前安装的cuda10.0的时候,已经安装了较高版本的显卡驱动,适配cuda10.1
3. 是否修改软连接,都可以
A symlink already exists at /usr/local/cuda. Update to this installation? x
x Yes ] Driver x
x No [ ] 418.39
如果没有修改的话,也可以重新链接到cuda10.1
sudo ln -snf /usr/local/cuda-10.1 /usr/local/cuda
4. 安装完成
===========
= Summary =
===========Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-10.1/
Samples: Not SelectedPlease make sure that- PATH includes /usr/local/cuda-10.1/bin- LD_LIBRARY_PATH includes /usr/local/cuda-10.1/lib64, or, add /usr/local/cuda-10.1/lib64 to /etc/ld.so.conf and run ldconfig as rootTo uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-10.1/binPlease see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.1/doc/pdf for detailed information on setting up CUDA.
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 418.00 is required for CUDA 10.1 functionality to work.
To install the driver using this installer, run the following command, replacing with the name of this run file:sudo .run --silent --driverLogfile is /var/log/cuda-installer.log
安装cudnn
tar xvf cudnn-10.1-linux-x64-v7.5.1.10.tgz
复制到cuda目录. include里面只有cudnn.h
sudo cp cuda/include/* /usr/local/cuda-10.1/include
sudo cp cuda/lib64/* /usr/local/cuda-10.1/lib64
重置cudnn.h文件的读写权限:
sudo chmod a+r /usr/local/cuda-10.1/include/cudnn.h
在自己的根目录下,指定cuda版本
vim ~/.bashrc
添加以下
#cuda
export PATH=/usr/local/cuda-10.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
退出保存,
source ~/.bashrc
查看当前使用cuda的版本
username@ubuntu:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105