Problem with RDC

Hi, I am trying to run the following program.

I am working on CUDA 8.0 and Visual Studio 2013. When setting -rdc = false, I got the following error.

error : kernel launch from __device__ or __global__ functions requires separate compilation mode

However, after setting -rdc = true, I got the following errors.

error LNK2001: unresolved external symbol ___fatbinwrap_66_tmpxft_0000a66c_00000000_18_cuda_device_runtime_compute_61_cpp1_ii_8b1a5d37
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

How can I solve this problem? Thank you!

It’s not clear how you set -rdc=true

If you simply added that compile switch, that’s not the correct way to do it in visual studio. You should use the project configuration to change to a relocatable device code project. This should address the first (LNK2001) error.

The second error is arising due to the fact that this project has an unusual mechanism for providing a main() routine, and it is apparently not working. You’ll need to investigate that.

Thanks for the response. I set -rdc=true in Project -> Properties -> Configuration Properties -> CUDA C/C++ -> Common -> Generate Relocatable Device Code, and this does not seem to address the LNK2001 error. Are there any steps that I am missing? Thanks!

I think my problem is the same as the one described in Hopefully this can help others with the same issue.