ubuntu22安装cuda
时间: 2023-11-05 18:05:16 浏览: 98
Linux下安装cuda
安装CUDA和Nvidia驱动的步骤如下:
1. 首先,使用以下命令进行Nvidia驱动的安装:
```
chmod +x NVIDIA-Linux-x86_64-460.106.00.run
sudo bash ./NVIDIA-Linux-x86_64-460.106.00.run
```
2. 下载并安装CUDA 11.2:
```
wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda_11.2.0_460.27.04_linux.run
sudo sh cuda_11.2.0_460.27.04_linux.run
```
3. 下载并安装CuDNN 8.2.1:
```
tar zxvf cudnn-11.3-linux-x64-v8.2.1.32.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda-11.2/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.2/lib64
sudo chmod a+r /usr/local/cuda-11.2/include/cudnn.h /usr/local/cuda-11.2/lib64/libcudnn*
```
4. 更新initramfs并重启系统:
```
sudo update-initramfs -u
sudo reboot
```
至此,你已经成功安装了CUDA和Nvidia驱动。
阅读全文