NVIDIA CUDA Compiler Driver NVCC

https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/

The documentation for nvcc, the CUDA compiler driver.

CUDA code runs on both the central processing unit (CPU) and graphics processing unit (GPU). NVCC separates these two parts and sends host code (the part of code which will be run on the CPU) to a C compiler like GNU Compiler Collection (GCC) or Intel C++ Compiler (ICC) or Microsoft Visual C++ Compiler, and sends the device code (the part which will run on the GPU) to the GPU. The device code is further compiled by NVCC. NVCC is based on LLVM.

Any source file containing CUDA language extensions (.cu) must be compiled with nvcc.

  • Nvidia CUDA Compiler (NVCC)

Nvidia CUDA Compiler (NVCC) is a compiler by Nvidia intended for use with CUDA.

strong@foreverstrong:~$ whereis nvcc
strong@foreverstrong:~$ which nvcc
/usr/local/cuda-8.0/bin/nvcc
C:\Users\cheng>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:26_Pacific_Standard_Time_2019
Cuda compilation tools, release 10.1, V10.1.105

C:\Users\cheng>

C:\Users\cheng>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:26_Pacific_Standard_Time_2019
Cuda compilation tools, release 10.1, V10.1.105

C:\Users\cheng>
C:\Users\cheng>nvidia-smi
Tue Feb 25 23:59:24 2025
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 528.49       Driver Version: 528.49       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ... WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   44C    P0    22W /  60W |      0MiB /  6144MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

C:\Users\cheng>

nvidia-sminvcc --version 显示的 CUDA Version 差异:

  • nvcc --version refers to the version of the CUDA toolkit installed on the system. The CUDA toolkit includes the compiler, libraries, and other tools. (NVIDIA Toolkit driver)
  • nvidia-smi refers to the CUDA GPU driver version supported by the installed NVIDIA graphics driver. (GPU driver, aka CUDA Driver)

The CUDA driver version must be greater than or equal to the CUDA toolkit version for proper functionality.

strong@foreverstrong:~$ ls -l /dev/nv*
crw-rw-rw- 1 root root 195,   0 11月  7 14:59 /dev/nvidia0
crw-rw-rw- 1 root root 195, 255 11月  7 14:59 /dev/nvidiactl
crw-rw-rw- 1 root root 195, 254 11月  7 14:59 /dev/nvidia-modeset
crw-rw-rw- 1 root root 242,   0 11月  7 14:59 /dev/nvidia-uvm
crw-rw-rw- 1 root root 242,   1 11月  7 19:07 /dev/nvidia-uvm-tools
4.2.8.23. --list-gpu-code (-code-ls)

List the non-accelerated gpu architectures (sm_XX) supported by the tool and exit.

If both --list-gpu-code and --list-gpu-arch are set, the list is displayed using the same format as the --generate-code value.

(base) yongqiang@yongqiang:~/software$ nvcc --list-gpu-code
sm_50
sm_52
sm_53
sm_60
sm_61
sm_62
sm_70
sm_72
sm_75
sm_80
sm_86
sm_87
sm_89
sm_90
(base) yongqiang@yongqiang:~/software$
4.2.8.24. --list-gpu-arch (-arch-ls)

List the non-accelerated virtual device architectures (compute_XX) supported by the tool and exit.

If both --list-gpu-arch and --list-gpu-code are set, the list is displayed using the same format as the --generate-code value.

(base) yongqiang@yongqiang:~/software$ nvcc --list-gpu-arch
compute_50
compute_52
compute_53
compute_60
compute_61
compute_62
compute_70
compute_72
compute_75
compute_80
compute_86
compute_87
compute_89
compute_90
(base) yongqiang@yongqiang:~/software$

References

[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Yongqiang Cheng

梦想不是浮躁,而是沉淀和积累。

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

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

打赏作者

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

抵扣说明:

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

余额充值