[CMake] CMake 3.9.x Visual Studio CUDA PDB/compiler flags issues
Mueller-Roemer, Johannes Sebastian
Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de
Wed Sep 6 10:36:07 EDT 2017
If the comment is wrt 3., the result is the same no matter if I use a space or an equals sign, if I double escape the quotes (e.g., use the value as you wrote it in the cmake-gui for CMAKE_CUDA_FLAGS), the value in VS becomes compute_20,"sm_20,compute_20" instead of compute_20,sm_20,compute_20, which is equally illegal and will cause the same error message, also double escaping should not be necessary for a subset of flags (Xcompiler works fine without it, even if the default values are pointless).
If the comment is wrt 2., this is the line automatically generated by CMake/VS when not passing in any gencode flags explicitly.
Or am I misunderstanding what you mean?
Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5 | 64283 Darmstadt | Germany
Tel +49 6151 155-606 | Fax +49 6151 155-139
johannes.mueller-roemer at igd.fraunhofer.de<mailto:johannes.mueller-roemer at igd.fraunhofer.de> | www.igd.fraunhofer.de<http://www.igd.fraunhofer.de>
From: Robert Maynard [mailto:robert.maynard at kitware.com]
Sent: Wednesday, September 6, 2017 15:38
To: Mueller-Roemer, Johannes Sebastian <Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de>
Cc: cmake at cmake.org
Subject: Re: [CMake] CMake 3.9.x Visual Studio CUDA PDB/compiler flags issues
As far as gencode goes, your line has errors. With CUDA 8 it should look like:
-gencode arch=compute_20,code=\"sm_20,compute_20\"
On Mon, Sep 4, 2017 at 4:06 AM, Mueller-Roemer, Johannes Sebastian <Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de<mailto:Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de>> wrote:
I’m having two issues with debug symbols for CUDA libraries on a project:
1. The PDBs are not placed where the linker later expects to find them (haven’t been able to replicate this in a minimal project yet)
2. Trying to circumnavigate this issue by using “/Z7” instead of “/Zi” does not work, Zi is always used (replicable in any project with CUDA)
Replication steps: Replace -Zi or /Zi in CMAKE_*_FLAGS* (CUDA, CXX, C) by -Z7 or /Z7. Build and see several warnings like “cl : Command line warning D9025: overriding '/Z7' with '/Zi'” in the output window.
And do the flags in the –Xcompiler make sense at all in VS? The CUDA build tools seem to determine these automatically anyways… for example I get the following call in the above scenario:
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2015 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler="/EHsc -Z7 -Ob0" -g -D_WINDOWS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd /GR" -o A.dir\Debug\a.cu.obj "D:\jsroemer\projects\cuda-pdb-test\a\a.cu<http://a.cu>"
3. Also, -gencode flags do not behave as expected when given in the form -gencode=arch=compute_20,code="sm_20,compute_20", as this causes the VS build system to error out:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets(216,9): error : Item '..\..\a\a.cu<http://a.cu>' Code Generation value is not in the expected format '[Arch],[Code]'.
The code generation value in this example is set to compute_20,sm_20,compute_20 by CMake.
Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5 | 64283 Darmstadt | Germany
Tel +49 6151 155-606<tel:+49%206151%20155606> | Fax +49 6151 155-139<tel:+49%206151%20155139>
johannes.mueller-roemer at igd.fraunhofer.de<mailto:johannes.mueller-roemer at igd.fraunhofer.de> | www.igd.fraunhofer.de<http://www.igd.fraunhofer.de>
--
Powered by www.kitware.com<http://www.kitware.com>
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170906/a2dac1cd/attachment.html>
More information about the CMake
mailing list