我正在为我的仓库构建示例cuda-api-wrappers
。前段时间,我遇到一个问题:每当我尝试.cu
使用“合作组”机制编译一个编码的文件时,我都会收到一条错误消息:
ptxas fatal : Unresolved extern function 'cudaCGGetIntrinsicHandle'
这很奇怪,因为我只是在编译。好吧,我使用这个 nVIDIA DevTalk 论坛帖子上的建议解决了这个问题:
我建议...指定
-rdc=true
我做到了,这似乎奏效了。然而,现在(在 Devuan 3 ~= Debian 10 上使用 CUDA 10.1),我在链接过程中遇到错误:
/usr/bin/nvcc -I/path/to/src/cuda-api-wrappers/src -I/path/to/src/cuda-api-wrappers -gencode arch=compute_61,code=sm_61 -Xcompiler -Wall -O3 -DNDEBUG -rdc true -std=c++11 -x cu -c /path/to/src/cuda-api-wrappers/examples/by_runtime_api_module/execution_control.cu -o CMakeFiles/execution_control.dir/examples/by_runtime_api_module/execution_control.cu.o
/usr/bin/nvcc -gencode arch=compute_61,code=sm_61 -Xcompiler -Wall -O3 -DNDEBUG -Xcompiler=-fPIC -Wno-deprecated-gpu-targets -shared -dlink CMakeFiles/execution_control.dir/examples/by_runtime_api_module/execution_control.cu.o -o CMakeFiles/execution_control.dir/cmake_device_link.o -L/usr/lib/x86_64-linux-gnu/stubs -L/usr/lib/gcc/x86_64-linux-gnu/8 lib/libcuda-api-wrappers.a /usr/lib/x86_64-linux-gnu/libcudart_static.a -lpthread -ldl -lcudadevrt -lcudart_static -lrt
nvlink error : Undefined reference to 'cudaCGGetIntrinsicHandle' in 'CMakeFiles/execution_control.dir/examples/by_runtime_api_module/execution_control.cu.o'
nvlink error : Undefined reference to 'cudaCGSynchronizeGrid' in 'CMakeFiles/execution_control.dir/examples/by_runtime_api_module/execution_control.cu.o'
为什么我仍然收到这些错误,我该怎么办?