CUDA 7.5RC VS13 CUDA Host additional compiler options are being put in front of the d-linking comman

CUDA C/C++ Host additional compiler options (NOT the additional options for the project’s C/C++ command line options) are being added in front of the device linking command, generating an error because the command line doesn’t know what -Xcompiler is.

This only happens in CUDA 7.5RC; 7.0 doesn’t have the problem.

This looks like some sort of bug, but it is not immediately clear where exactly that bug maybe located.

Maybe nvcc erroneously does not strip out the “-Xcompiler” prefix before passing this to the host compiler. Another possibility is that an ill-formed commandline is being passed to nvcc: a command line containing the sequence -Xcompiler -Xcompiler may be constructed inadvertently. For example -Xcompiler [opt1] -Xcompiler [opt2], where due to a configuration setup error [opt1] evaluates to an empty string?

If, after double checking your build settings and examining the detailed MSVS logs, you are convinced that only well-formed command lines are being passed to nvcc, I would suggest filing a bug with NVIDIA.

I forgot to mention that the project was originally a CUDA 7.0 project; I only changed the build customization tickers to “convert” it into a CUDA 7.5RC one. I have both CUDA 7.0 and 7.5RC on my machine. Could this be related to the issue? I’ll see if I can reproduce the issue on a new project; but I am not able to create CUDA 7.0 projects in VS2013 anymore (no doubt a 7.0/7.5RC coexisting issue)

I’ve mixed the two additional compiler options up. The first post is now fixed. Sorry about the confusion!

I now have a minimally reproducible procedure:

  1. Create a CUDA 7.5RC project in VS2013
  2. Set -rdc=true in CUDA C/C++ → Common
  3. Set any additional compiler options in CUDA C/C++ → Host (I set it to /FS)
  4. Rebuild

If someone else can reproduce this I’ll file a bug report.

I have the exact same problem in VS2013 with CUDA 7.5 final release. I am trying to use OpenMP and dynamic parallelism at the same time. Therefore I am setting
in CUDA Common, Generate relocatable code: yes -rdc=true
in CUDA Host, Additional compiler option: /openmp

When I compile my project I get:

D:\ecole\Workspace\vs2013_projects\vincent_doctorat\graph_dll><b>-Xcompiler /openmp</b> "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin\nvcc.exe" -dlink -o x64\Release_sm35\graph_dll.device-link.obj -Xcompiler "/EHsc /W3 /nologo /O2 /Zi  /MD " -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\x64" cudadevrt.lib cudart.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50  --machine 64 x64\Release_sm35\graph_device.cu.obj 
  '-Xcompiler' is not recognized as an internal or external command,
  operable program or batch file.

and the

<b>-Xcompiler /openmp</b>

is the problem.

Have you found any solution? Thank you in advance.

I usually set “-Xcompiler /something” on Property_Pages/Configuration_Properties/CUDA_C/C++/Command_Line/Additional_Options