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

相关推荐
黄白柴柴3 天前
cudnn版本gpu架构
cuda·cudnn
IT修炼家8 天前
auto-gptq安装以及不适配软硬件环境可能出现的问题及解决方式
大模型·cuda·auto-gptq
爱听歌的周童鞋8 天前
Depth-Anything推理详解及部署实现(下)
tensorrt·cuda·deploy·mde·depth anything
因为风的缘故~8 天前
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-guoyang9 天前
tensorflow gpu版安装(直接anaconda虚拟环境中配置cuda,无需主机安装cuda、cudnn)
深度学习·tensorflow·cuda·anaconda
self-motivation9 天前
gpu硬件架构
硬件架构·gpu·nvidia·tensor·cuda
枫舞雪域10 天前
Ubuntu22.04安装英伟达驱动
linux·笔记·cuda·isaacsim·iassclab
爱串门的小马驹13 天前
CUDA 计时功能,记录GPU程序/函数耗时,cudaEventCreate,cudaEventRecord,cudaEventElapsedTime
cuda
程序员非鱼15 天前
深入解析神经网络的GPU显存占用与优化
人工智能·深度学习·神经网络·机器学习·nvidia·cuda
kolaseen17 天前
NCU使用指南及模型性能测试(pytorch2.5.1)
pytorch·python·深度学习·docker·gpu·cuda·ncu