下载cuda文件
自行选择版本
https://developer.nvidia.com/cuda-downloads
image.png
安装
下载合适的版本,下载到本地
通过nvidia-detect -v命令查看驱动的版本
[admin@A01-R15-I47-118-0825868 http-cnn-rnn]$ nvidia-detect -v
Probing for supported NVIDIA devices...
[10de:1b38] NVIDIA Corporation Device 1b38
This device requires the current 418.43 NVIDIA driver kmod-nvidia
[10de:1b38] NVIDIA Corporation Device 1b38
This device requires the current 418.43 NVIDIA driver kmod-nvidia
[1a03:2000] ASPEED Technology, Inc. ASPEED Graphics Family
[10de:1b38] NVIDIA Corporation Device 1b38
This device requires the current 418.43 NVIDIA driver kmod-nvidia
[10de:1b38] NVIDIA Corporation Device 1b38
This device requires the current 418.43 NVIDIA driver kmod-nvidia
WARNING: Xorg log file /var/log/Xorg.0.log does not exist
WARNING: Unable to determine Xorg ABI compatibility
WARNING: The driver for this device does not support the current Xorg version
通过上述命令说明我们的驱动需要下载418.43的版本,我们只需要找对应418.43 驱动的cuda就行
通过nvidia-msi也能查看
[admin@A01-R15-I47-121-0825870 users]$ nvidia-smi
Sun Mar 10 13:58:41 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.43 Driver Version: 418.43 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla P40 Off | 00000000:02:00.0 Off | 0 |
| N/A 24C P0 51W / 250W | 0MiB / 22919MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 Tesla P40 Off | 00000000:03:00.0 Off | 0 |
| N/A 25C P0 51W / 250W | 0MiB / 22919MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 2 Tesla P40 Off | 00000000:83:00.0 Off | 0 |
| N/A 26C P0 51W / 250W | 0MiB / 22919MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 3 Tesla P40 Off | 00000000:84:00.0 Off | 0 |
| N/A 26C P0 51W / 250W | 0MiB / 22919MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
通过上述的结果,得知我们需要下载10.1的cuda
wget https://developer.download.nvidia.cn/compute/cuda/10.1/secure/Prod/local_installers/cuda_10.1.105_418.39_linux.run?JxiB7NQ4_56qMViu4uHKi1iR8c5bHTXGvWeOBrUjhnUzji2Z_fWMX3g4qEFSZZwMLad7TRSb2b-WB7SfaEd_ooUe41yV4K-hH7oM8oydaRWaz129kM_VJfEQ6QP6RdarY3wUichr2wAVLRRAElpSwyc4Pxi3pi5H6EjWoARIeOQ1w0RxPHEHb6lkBYg
执行脚本
sudo sh cuda_10.1.105_418.39_linux.run
[admin@A01-R15-I47-121-0825870 software]$ sudo sh cuda_10.1.105_418.39_linux.run
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
xqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqx
x Do you accept the above EULA? (accept/decline/quit): x
x x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
按提示操作
对于上面的提示 ,输入accept
后面还有一次回车,然后自动安装
检测是否成功
cd /usr/local/cuda/bin
nvcc --version
加入环境变量
export CUDA_HOME=/usr/local/cuda
export PATH="/usr/local/cuda/bin:/home/admin/anaconda3/bin:$PATH"
LD_LIBRARY_PATH=/usr/local/cuda/lib64:/home/admin/anaconda3/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
cuda卸载
cd /usr/local/cuda/bin
./cuda-uninstaller
网友评论