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

相关推荐
DWQY12 天前
ubuntu22.04降级安装CUDA11.3
cuda
Little_Yuu15 天前
windows11(或centos7)安装nvidia显卡驱动、CUDA、cuDNN
cuda·cudnn
engchina25 天前
CUTLASS:高性能 CUDA 线性代数模板库详解
人工智能·线性代数·cuda·cutlass
黄白柴柴1 个月前
cudnn版本gpu架构
cuda·cudnn
IT修炼家1 个月前
auto-gptq安装以及不适配软硬件环境可能出现的问题及解决方式
大模型·cuda·auto-gptq
爱听歌的周童鞋1 个月前
Depth-Anything推理详解及部署实现(下)
tensorrt·cuda·deploy·mde·depth anything
因为风的缘故~1 个月前
Ubuntu22.04安装cuda12.1+cudnn8.9.2+TensorRT8.6.1+pytorch2.3.0+opencv_cuda4.9+onnxruntime-gpu1.18
pytorch·深度学习·tensorrt·cuda·anaconda·cudnn
ai-guoyang1 个月前
tensorflow gpu版安装(直接anaconda虚拟环境中配置cuda,无需主机安装cuda、cudnn)
深度学习·tensorflow·cuda·anaconda
self-motivation1 个月前
gpu硬件架构
硬件架构·gpu·nvidia·tensor·cuda
枫舞雪域1 个月前
Ubuntu22.04安装英伟达驱动
linux·笔记·cuda·isaacsim·iassclab