ubuntu.24安装cuda

1.下载CUDA Toolkit

https://developer.nvidia.com/cuda-toolkit-archive

2.按照命令下载,安装

sudo sh cuda_12.2.2_535.104.05_linux.run

3.环境变量

sudo vi /etc/profile

最后面添加

export PATH="/usr/local/cuda-12.2/bin: P A T H " e x p o r t L D L I B R A R Y P A T H = " / u s r / l o c a l / c u d a − 12.2 / l i b 64 : PATH" export LD_LIBRARY_PATH="/usr/local/cuda-12.2/lib64: PATH"exportLDLIBRARYPATH="/usr/local/cuda−12.2/lib64:LD_LIBRARY_PATH"

重启

reboot

检查

nvcc -V

4.Removing CUDA Toolkit and Driver

Ubuntu and Debian

To remove CUDA Toolkit:

sudo apt-get --purge remove "cuda " "cublas " "cufft " "cufile " "curand "

"cusolver " "cusparse " "gds-tools " "npp " "nvjpeg " "nsight*" "nvvm"

To remove NVIDIA Drivers:

sudo apt-get --purge remove "nvidia" "libxnvctrl*"

To clean up the uninstall:

sudo apt-get autoremove

5.官方文档

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/contents.html

6.安装cuddn

https://developer.nvidia.cn/rdp/cudnn-archive

sudo tar -xf cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz

cd cudnn-linux-x86_64-8.9.7.29_cuda12-archive/

sudo cp lib/libcudnn* /usr/local/cuda-12.2/lib64

sudo cp include/* /usr/local/cuda-12.2/include

sudo chmod a+r /usr/local/cuda-12.2/include/cudnn.h

sudo chmod a+r /usr/local/cuda-12.2/lib64/libcudnn*

#测试

cat /usr/local/cuda-12.2/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

相关推荐
扫地的小何尚4 天前
NVIDIA RTX 系统上使用 llama.cpp 加速 LLM
人工智能·aigc·llama·gpu·nvidia·cuda·英伟达
吃肉夹馍不要夹馍6 天前
CublasLt 极简入门
cuda·cublas·gemm·cublaslt
Code-world-18 天前
Ubuntu系统安装NVIDIA驱动、CUDA、PyTorch等GPU深度学习环境
linux·pytorch·深度学习·cuda·深度强化学习
狼刀流19 天前
(8) cuda分析工具
python·cuda
CodeLearing20 天前
【CUDA代码实践03】m维网格n维线程块对二维矩阵的索引
线性代数·矩阵·cuda
坐望云起24 天前
Ubuntu20.04 更新Nvidia驱动 + 安装CUDA12.1 + cudnn8.9.7
linux·ubuntu·nvidia·cuda·onnx·1024程序员节
狼刀流25 天前
(5)cuda中的grid、block
c++·cuda·1024程序员节
Mundaneman1 个月前
架构发展史
架构·cuda
张大饼的最爱1 个月前
CUDA 共享内存 shared memory
cuda·cuda c