lumark / PWP3D

PWP3D, Real-time segmentation and tracking of 3D objects.
93 stars 47 forks source link

runtime error "invalid device symbol" at CUDAConvolution.cu(100), cudaMemcpyToSymbol func call #4

Open zhangxaochen opened 8 years ago

zhangxaochen commented 8 years ago

at CUDAConvolution.cu, Line 100, this code: perseusSafeCall(cudaMemcpyToSymbol(dKernelConvolution, cudaData->hKernelConvolution, KERNEL_SIZE)); throws an error at runtime:

==[APP] Init Target ROI ==
E:/Github/PWP3D/PerseusLib/CUDA/CUDAConvolution.cu(100) : cudaSafeCall() Runtime API error : invalid device symbol.

the var/symbol is defined previously as:

__device__ __constant__ float dKernelConvolution[KERNEL_WIDTH];
const int KERNEL_SIZE = KERNEL_WIDTH * sizeof(float);

My environment in windows10, vs2013, gtx750ti (maxwell arch), cuda6.5, and I don't find a solution because:

  1. in cudaMemcpyToSymbol indeed dKernelConvolution is used, not the string varname "dKernelConvolution";
  2. the var dKernelConvolution is defined as __device__ __constant, also should be correct.

so is there anyone who has the same issue as mine?

weihaosky commented 7 years ago

I have solved this issue. You need to change the compute architectures setting to fit your GPU in PWP3D-master/PerseusLib/CMakeLists.txt like "arch=compute_50,code=sm_50 -gencode arch=compute_60,code=sm_60"