NVIDIA 驱动和 CUDA 版本信息速查

本文档详细介绍了CUDA版本与NVIDIA驱动的兼容性,包括CUDA版本与NVIDIA驱动的对应关系,以及如何查找CUDA版本、GPU的ComputeCapability。还提供了升级NVIDIA驱动时的注意事项和操作步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

背景

之前和 NVIDIA 驱动和 CUDA 搏斗比较多,因此记录一下一些常用信息,方便查询。

常用地址

CUDA 版本与 NVIDIA 驱动兼容性

可以通过 apt show cuda-runtime-x-x 找到:

  • cuda 12.3 >= 545 (Release Notes: 525)
  • cuda 12.2 >= 535 (Release Notes: 525)
  • cuda 12.1 >= 530 (Release Notes: 525)
  • cuda 12.0 >= 525 (Release Notes: 525)
  • cuda 11.8 >= 520 (Release Notes: 450)
  • cuda 11.7 >= 515 (Release Notes: 450)
  • cuda 11.6 >= 510 (Release Notes: 450)
  • cuda 11.5 >= 495 (Release Notes: 450)
  • cuda 11.4 >= 470 (Release Notes: 450)
  • cuda 11.3 >= 465 (Release Notes: 450)
  • cuda 11.2 >= 460 (Release Notes: 450)
  • cuda 11.1 >= 455 (Release Notes: 450)
  • cuda 11.0 >= 450 (Release Notes: 450)
  • cuda 10.2 >= 440
  • cuda 10.1 >= 418
  • cuda 10.0 >= 410
  • cuda 9.2 >= 396
  • cuda 9.1 >= 390
  • cuda 9.0 >= 384

使用 nvidia-smi 看到的 CUDA 版本,通常就是这个驱动在上表里对应的 CUDA 版本,例如内核驱动版本是 470 的话,看到的 CUDA 版本就是 11.4。

实际上兼容的驱动版本会比 APT 宣称的更多一些:官方文档 里面写了 CUDA 11.x 可以兼容 NVIDIA >= 450。

CUDA 版本和 GCC/Clang 版本兼容性

可以在 cuda/include/crt/host_config.h 文件里找到:

  • cuda 12.1: gcc <= 12, 3.2 < clang < 16
  • cuda 12.0: gcc <= 12, 3.2 < clang < 15
  • cuda 11.8: gcc <= 11, 3.2 < clang < 15
  • cuda 11.5: gcc <= 11
  • cuda 11.4: gcc <= 10
  • cuda 11.3: gcc <= 10, 3.2 < clang < 12
  • cuda 11.1: gcc <= 10, 3.2 < clang < 11
  • cuda 11.0: gcc <= 9, 3.2 < clang < 10
  • cuda 10.2: gcc <= 8, 3.2 < clang < 9
  • cuda 10.1: gcc <= 8, 3.2 < clang < 9
  • cuda 10.0: gcc <= 7
  • cuda 9.1: gcc <= 6

CUDA 版本与显卡兼容性

编译选项与显卡对应关系 Matching CUDA arch and CUDA gencode for various NVIDIA architectures - Arnon Shimoni

可以在 nvcc --help 搜索 gpu-architecture 找到:

  • cuda 12.0 sm_50 to sm_90a
  • cuda 11.8 sm_35 to sm_90
  • cuda 11.4 sm_35 to sm_87
  • cuda 11.3 sm_35 to sm_86
  • cuda 11.1 sm_35 to sm_86
  • cuda 11.0 sm_35 to sm_80
  • cuda 10.2 sm_30 to sm_75
  • cuda 10.0 sm_30 to sm_75
  • cuda 9.1 sm_30 to sm_72
  • cuda 9.0 sm_30 to sm_70

显卡的 Compute Capability 可以在 CUDA GPUs - Compute Capability | NVIDIA Developer 找到:

  • H100: 90
  • A100: 80
  • V100: 70
  • P100: 60

升级 NVIDIA 驱动

升级后,需要 rmmod 已有的,再 modprobe 新的:

sudo rmmod nvidia_uvm nvidia_drm nvidia_modeset nvidia && sudo modprobe nvidia

如果发现 rmmod 失败,可以 lsof /dev/nvidiactl 查看谁在占用。DGX OS 上需要停止:

sudo systemctl stop nvsm.service
sudo systemctl stop nvidia-dcgm.service 

除了 /dev/nvidia* 可能被占用以外,还需要用 lsof 检查 /dev/dri/render*

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

才 神

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值