Hello,
I’m trying to translate the “template” project from run time to driver API. I have all the calls I can see converted (such as cudaMalloc → cuMemAlloc), but when I call make I get errors like:
obj/release/boucuda.cu.o: In function __device_stub__Z10testKernelPfS_(float*, float*)': tmpxft_00006788_00000000-1_boucuda.cudafe1.cpp:(.text+0x164): undefined reference to
cudaSetupArgument’
tmpxft_00006788_00000000-1_boucuda.cudafe1.cpp:(.text+0x185): undefined reference to cudaSetupArgument' tmpxft_00006788_00000000-1_boucuda.cudafe1.cpp:(.text+0x19e): undefined reference to
cudaLaunch’
I have USEDRVAPI = 1 in the make file, so I don’t understand where or why it is trying to compile to the run time library. Does cutil assume runtime is always available?
Thanks for any ideas on how to fix this.
Edit - I think I have a clue now. I commented out everything, so the file was just main(argc argv){} and I still got this:
obj/release/boucuda.cu.o: In function __sti____cudaRegisterAll_42_tmpxft_00006c59_00000000_4_b oucuda_cpp1_ii_main()': tmpxft_00006c59_00000000-1_boucuda.cudafe1.cpp:(.text+0xba): undefined reference to
__cudaRegisterFatBinary’
obj/release/boucuda.cu.o: In function __cudaUnregisterBinaryUtil()': tmpxft_00006c59_00000000-1_boucuda.cudafe1.cpp:(.text+0xf8): undefined reference to
__cudaUnregisterFatBinary’
collect2: ld returned 1 exit status
make: *** […/…/bin/linux/release/boucuda] Error 1
The difference between this and deviceQueryDrv is the lack of a *.cu file in deviceQueryDrv. nvcc assumes the runtime library is part of a file if it uses the .cu form.
I’ll see what happens tomorrow when I change it from .cu to .cpp. It’d be nice to know why the runtime doesn’t work, but that is another story…