Reputation: 199
I am getting undefined symbol error for cuMemcpyDtoH_v2 when trying to compile my code. I guess my question is where is cuMemcpyDtoH_v2 defined? I thought it would be defined in the cuda runtime enviornment but that appears to not be the case. Here is my code:
#include </usr/local/cuda/include/cufft.h>
#include </usr/local/cuda/include/cuda.h>
void main()
{
...
cuMemcpyDtoH_v2(v1, v2, ds);
...
}
To compile I am using the python disutils.core setup.py since I am linking python code to cuda code and creating a Python C extension.
python myFunc.py -build_ext --inplace -lcudart -lcufft -L"/usr/local/cuda/lib64/"
myFunc.py has a call to the disutils.core.setup() command which is used to compile python extensions.
I assume that cuMemcpyDtoH_v2 would be defined in the cuda runtime enviornment which I believe that I am linking to with the "-lcudart" command but perhaps that is not the case.
I am very new to C++ programming and Cuda so I could perhaps be making a very stupid mistake somewhere. I would appreciate any help.
Upvotes: 0
Views: 2367
Reputation: 199
Thanks to Robert Crovella I was able to get this working. According to Robert function calls that start with cu usually link to the driver API and functions that start with cuda usually link to the CUDA rumtime API. So I needed to link to the cuda driver API using the following command:
python myfunc.py -build-ext --inplace -lcudart -lcudafft -L"/usr/local/cuda/lib64" -lcuda -L"/usr/local/cuda/lib64/stubs/"
Note: I am using CUDA version 9.1
Upvotes: 1