Nvcc overrides /Z7 with /Zi

Hi,

I have a problem with CUDA 10.0. We are building our solution file with VS2017 + Incredibuild. Incredibuild doesn’t support the /Zi flag (pdb error occurs randomly). so the IB support suggested that we should use /Z7 instead. We changed our compiler flags according to this, but after the cmake generation I can see in the logs that all of the nvcc parts are using the old flag:

“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc.exe” … -Xcompiler "/EHsc /W0 /nologo /Od /FdDebug\vc141.pdb /FS /Zi /RTC1 …

How should I change that behaviour?

Thanks in advance,
Gergely Pilisi

Strange, 0 answer. I am the only one who run into this?

How many people use Incredibuild? I hadn’t even heard of it until I read this thread. It seems to me you would want to tell IB to get a move on and go fix their bug (“doesn’t support the /Zi flag”).

About 20 IB users. And it’s not a bug. IB builds the projects parallel and sometimes they try to write the same .pdb file. The solution is: change /Zi to /Z7, and every other projects are fine with that. Only the CUDA related compiles are failing, randomly. The main problem is that nvcc forces /Zi when cmake generates the files even if I strictly use /Z7 in our compiler flags.

So who constructs the commandline with the offending flag now? Incredibuild, MSVS, cmake, or actually nvcc? I have been a user of Microsoft C/C++ compilers since they ran on 16-bit DOS. I don’t recall problems with /Zi, it’s a perfectly legitimate flag to specify and use. IMHO, if IB has trouble parallelizing builds that use /Zi, that is IB’s problem to solve, worst case by forcing serialization. This, to me, is a bug (namely, invoking undefined behavior): “IB builds the projects parallel and sometimes they try to write the same .pdb file.”

Anyhow, the answer to your question seems to be: the intersection of the three sets “IB user”, “CUDA user”, “NVIDIA forum participant”, possibly has cardinality 1 at this time.

If you would like to see changes in how nvcc behaves, you can always file a feature request via the bug reporting form.