2

I know how to compile a CUDA code from Matlab, i.e., by compiling to a PTX file and executing by parallel.gpu.CUDAKernel('function name');

I'm now in a trouble with launching a CUDA code using dynamic parallelism from Matlab.

I was able to manage PTX compilation with the command

nvcc -ptx DynamicParalell.cu -o DynamicParalell.ptxw64 -rdc=true -lcudadevrt -gencode=arch=compute_35,code=sm_35

The compilation was successful, but if I run the compiled code from Matlab by parallel.gpu.CUDAKernel('function name');, I get the following error message:


An error occurred during PTX compilation of . The information log was:

The error log was: ptxas : fatal error : Unresolved extern function 'cudaGetParameterBuffer The CUDA error code was: CUDA_ERROR_NO_BINARY_FOR_GPU.


People talk about launching dynamic parallelism from Visual Studio, but not from Matlab.

Does anyone know how to do it?

I learned that error message cudaGetParameterBuffer has to do with \Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\lib\x64\cudadevrt.dll, which I already have.

Thanks in advance!

Vitality
  • 20,705
  • 4
  • 108
  • 146
  • 2
    Perhaps I'm wrong, but it seems to me that the procedure in [Run CUDA or PTX Code on GPU](http://www.mathworks.it/it/help/distcomp/run-cuda-or-ptx-code-on-gpu.html#bsic5ih-1) will not work if you try to link libraries at the compilation stage, since it requires to work on `.ptx` files which are the result of compilation of `.cu` files having only `__global__` functions. This may be the reason why you have the unresolved extern error when you launch the function from Matlab: you are not really linking the cudadevrt library. – Vitality Jan 17 '14 at 06:29
  • 1
    You may wish to try the procedure in [Compiling CUDA mex files with Visual Studio](http://www.orangeowlsolutions.com/archives/498). You can easily make a test by the downloadable Visual Studio 2010 project. – Vitality Jan 17 '14 at 06:30

0 Answers0