一、安装前准备
安装好显卡驱动
shuchengyang@shuchengyang-PC:/usr$ nvidia-smi Thu Feb 23 23:02:16 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.85.12 Driver Version: 525.85.12 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 Tesla P100-PCIE... Off | 00000000:02:00.0 Off | 0 | | N/A 19C P0 25W / 250W | 0MiB / 16384MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ | 1 Tesla P100-PCIE... Off | 00000000:83:00.0 Off | 0 | | N/A 19C P0 25W / 250W | 0MiB / 16384MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+
发现驱动已安装好,需要CUDA版本为12.0
二、下载CUDA
https://developer.nvidia.com/cuda-toolkit-archive
三、安装
此处我使用Ubuntu,利用run安装。
wget https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run sudo sh cuda_12.0.1_525.85.12_linux.run
shuchengyang@shuchengyang-PC:~$ wget https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run --2023-02-23 23:18:47-- https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run 正在解析主机 developer.download.nvidia.com (developer.download.nvidia.com)... 152.199.39.144 正在连接 developer.download.nvidia.com (developer.download.nvidia.com)|152.199.39.144|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 301 Moved Permanently 位置:https://developer.download.nvidia.cn/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run [跟随至新的 URL] --2023-02-23 23:18:52-- https://developer.download.nvidia.cn/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run 正在解析主机 developer.download.nvidia.cn (developer.download.nvidia.cn)... 125.64.2.195, 125.64.2.196 正在连接 developer.download.nvidia.cn (developer.download.nvidia.cn)|125.64.2.195|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:4207617207 (3.9G) [application/octet-stream]
sudo sh cuda_12.0.1_525.85.12_linux.run 请输入密码: 验证成功
输入accept
驱动我已安装,此处不在安装驱动
执行install
Installation failed. See log at /var/log/cuda-installer.log for details.
经查,安装nvidia-fs失败
[INFO]: installation status shows that mofed is not installed,please install mofed before continuing nvidia_fs install. [ERROR]: Install of nvidia-fs failed, quitting [INFO]: md5 matches, removing file /var/log/nvidia/.uninstallManifests/ [ERROR]: boost::filesystem::remove: Directory not empty: "/var/log/nvidia/.uninstallManifests/" [INFO]: Removing symlink: /usr/local/cuda
此时,我不再安装vidia-fs。
=========== = Summary = =========== Driver: Not Selected Toolkit: Installed in /usr/local/cuda-12.0/ Please make sure that - PATH includes /usr/local/cuda-12.0/bin - LD_LIBRARY_PATH includes /usr/local/cuda-12.0/lib64, or, add /usr/local/cuda-12.0/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-12.0/bin ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 525.00 is required for CUDA 12.0 functionality to work. To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file: sudo <CudaInstaller>.run --silent --driver Logfile is /var/log/cuda-installer.log
四、配置环境变量
sudo vi .bashrc export PATH=/usr/local/cuda-12.0/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-12.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
使能环境变量
source .bashrc
验证环境:
shuchengyang@shuchengyang-PC:~$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA Corporation Built on Fri_Jan__6_16:45:21_PST_2023 Cuda compilation tools, release 12.0, V12.0.140 Build cuda_12.0.r12.0/compiler.32267302_0
还没有评论,来说两句吧...