I’m trying to compile a project with dynamic parallelism. I have read several old posts (typically 2013) but have not been able to successfully implement them. In particular I am experiencing compilation failures with MEX.
- The nvcc compile appears to work when running to compile processes in the following way:
system(‘nvcc --compile filename.cu -o filename.o --compiler-options -fPIC -rdc=true -gencode arch=compute_35,code=sm_35 -lcudadevrt’)
system(‘nvcc -arch=sm_35 -dlink filename.o -o filename_link.o --compiler-options -fPIC -lcudadevrt’)[/i]
- The ‘best?’ suggestion that I have found to compile mex files that include linking is as shown in the following:
mex filename.o filename_link.o -L"path-to-lib64" -lcudart -lcudadevrt
How are people actually accomplishing this today?
Matlab seems to have developed a new mex compile method for dynamic parallelism, per: mexcuda -dynamic as shown here https://www.mathworks.com/help/distcomp/mexcuda.html.
The issue that I seem to bump into when using this noted suggestion is that when compiling with g++5.4 and CUDA 8, the mex doesn’t recognize the compiler. My environment is ubuntu 16.04