【发布时间】:2021-09-08 11:54:31
【问题描述】:
我已经安装了 CUDA-11.3 和 NVIDIA 驱动程序版本 465,CMAKE 版本 3.16.3。 我试图编译工具包中包含的示例以验证安装,但收到以下错误。
make[1]: Entering directory '/home/user/NVIDIA_CUDA-11.3_Samples/0_Simple/simpleSeparateCompilation'
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../common/inc -m64 -dc --threads 0 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o simpleDeviceLibrary.o -c simpleDeviceLibrary.cu
nvcc fatal : Unknown option '--threads'
make[1]: *** [Makefile:321: simpleDeviceLibrary.o] Error 1
make[1]: Leaving directory '/home/user/NVIDIA_CUDA-11.3_Samples/0_Simple/simpleSeparateCompilation'
make: *** [Makefile:51: 0_Simple/simpleSeparateCompilation/Makefile.ph_build] Error 2
【问题讨论】:
-
您似乎没有使用 CUDA 11.3 工具包中的 nvcc。
threads选项仅在 CUDA 11.2 发布周期中添加到 nvcc。如果它无法识别该选项,则说明您正在使用旧版本构建新示例 -
@talonmies 我在谷歌上发现了这个问题,但我猜我使用的是 11.3 的 nvcc。 nvcc--version 给了我这个输出 nvcc:NVIDIA (R) Cuda compiler driver 版权所有 (c) 2005-2021 NVIDIA Corporation 建立于 Mon_May__3_19:15:13_PDT_2021 Cuda 编译工具,版本 11.3,V11.3.109 Build cuda_11.3.r11。 3/compiler.29920130_0
-
你确定
/usr/local/cuda/bin/nvcc是CUDA 11.3 吗? makefile 找到的和你的 shell 找到的可能不是一回事 -
@talonmies 哦,我的错。我已将 /usr/local/cuda 符号链接更新为指向 /usr/local/cuda-11.3 但不知何故它仍然仅指向 /usr/local/cuda-11.1。解决了这个问题,现在。谢谢。
-
我为将来犯同样错误的访问者添加了一个简短的社区 wiki 答案。如果您能接受它以使其在搜索中更加可见,我将不胜感激