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.
Background:
The nvcc compile appears to work when running to compile processes in the following way:
[i]
system(‘nvcc --compile filename.cu -o filename.o --compiler-options -fPIC -rdc=true -gencode arch=compute_35,code=sm_35 -lcudadevrt’)
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
(The packages for gcc-5.3 apparently are not being tagged as such on repositories, and each new version of gcc-5.x replaces the package in the gcc-5 tags, a poor choice IMO… so there’s no way to install gcc-5.3 via the package manager that I know of)
A variation of 1… install gcc-5.3 from source, into a separate directory (very important, so as to not replace the glibc libraries – otherwise your system will break) For that, see this thread (and post #3):
[url][ubuntu] How to downgrade gcc from 5.4 to 5.3?
Edit: You might want to check if you have the latest CUDA 8.0 version installed, which currently is 8.0.61. It’s possible that one is already fixed to include support for gcc 5.4, despite what the installation guide mentions, unsure.
I believe CUDA 8.0.61 works with gcc 5.4. I have installed CUDA 8.0.61 successfully on Fedora 25 using a manually built version of gcc 5.4. (F25 ships with gcc 6.3, and there are no packages for 5.4 that I could find.) It seems to work fine. You don’t have to edit any header files.