<div dir="ltr">As far as <span style="font-family:Calibri,sans-serif;font-size:14.6667px">gencode goes, your line has errors. With CUDA 8 it should look like:</span><div>







<p class="gmail-p1"><span class="gmail-s1">-gencode arch=compute_20,code=\"sm_20,compute_20\" </span></p><p class="gmail-p1"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 4, 2017 at 4:06 AM, Mueller-Roemer, Johannes Sebastian <span dir="ltr"><<a href="mailto:Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de" target="_blank">Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="DE" link="#0563C1" vlink="#954F72">
<div class="m_4624768089518785155WordSection1">
<p class="MsoNormal"><span lang="EN-US">I’m having two issues with debug symbols for CUDA libraries on a project:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="m_4624768089518785155MsoListParagraph"><u></u><span lang="EN-US"><span>1.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US">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)<u></u><u></u></span></p>
<p class="m_4624768089518785155MsoListParagraph"><u></u><span lang="EN-US"><span>2.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US">Trying to circumnavigate this issue by using “/Z7” instead of “/Zi” does not work, Zi is always used (replicable in any project with CUDA)<br>
<br>
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.<br>
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:<br>
<br>
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.<wbr>exe" -gencode=arch=compute_20,code=<wbr>\"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-<wbr>pdb-test\a\<a href="http://a.cu" target="_blank">a.cu</a>"<u></u><u></u></span></p>
<p class="m_4624768089518785155MsoListParagraph"><u></u><span lang="EN-US"><span>3.<span style="font:7.0pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US">Also, -gencode flags do not behave as expected when given in the form -gencode=arch=compute_20,code=<wbr>"sm_20,compute_20", as this causes the VS build system to error out:<br>
<br>
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\<wbr>v4.0\V140\BuildCustomizations\<wbr>CUDA 8.0.targets(216,9): error : Item '..\..\a\<a href="http://a.cu" target="_blank">a.cu</a>' Code Generation value is not in the expected format '[Arch],[Code]'.<br>
<br>
The code generation value in this example is set to compute_20,sm_20,compute_20 by CMake.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Fraunhofer-Institut für Graphische Datenverarbeitung IGD<u></u><u></u></span></p>
<p class="MsoNormal"><span>Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany<u></u><u></u></span></p>
<p class="MsoNormal"><span>Tel <a href="tel:+49%206151%20155606" value="+496151155606" target="_blank">+49 6151 155-606</a>  |  Fax <a href="tel:+49%206151%20155139" value="+496151155139" target="_blank">+49 6151 155-139</a><u></u><u></u></span></p>
<p class="MsoNormal"><span><a href="mailto:johannes.mueller-roemer@igd.fraunhofer.de" target="_blank"><span style="color:blue">johannes.mueller-roemer@igd.<wbr>fraunhofer.de</span></a> |
<a href="http://www.igd.fraunhofer.de" target="_blank"><span style="color:blue">www.igd.fraunhofer.de</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br></blockquote></div><br></div>