Boost C++ Libraries: Ticket #13152: nvcc Error: Boost 1.64.0 & CUDA 9.0 https://svn.boost.org/trac10/ticket/13152 <p> Compilation of files that include Boost fail with the CUDA Toolkit version 9. </p> <p> The reason for that is that at boost/config/compiler/nvcc.hpp, line 22 and 26 you use the macro <code>__CUDACC_VER__</code> for version checking, but the symbol has been deprecated in CUDA 9. </p> <p> Line 64 in <code>crt/common_functions.h</code> of the CUDA toolkit now reads: </p> <pre class="wiki">#define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead." </pre><p> The fix seems simple enough, instead of checking for the whole version, you could check separately for <code>__CUDACC_VER_MAJOR__</code> and <code>__CUDACC_VER_MINOR__</code> . </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13152 Trac 1.4.3 Alexander Korsunsky <a.korsunsky@…> Wed, 09 Aug 2017 11:46:13 GMT cc set https://svn.boost.org/trac10/ticket/13152#comment:1 https://svn.boost.org/trac10/ticket/13152#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">a.korsunsky@…</span> added </li> </ul> Ticket a.huebl@… Wed, 09 Aug 2017 13:10:34 GMT <link>https://svn.boost.org/trac10/ticket/13152#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13152#comment:2</guid> <description> <p> migrated comment from github: </p> <p> ouch, it might be worth opening a CUDA bug report as long as CUDA 9 is still in RC! (What's your exact nvcc version? 9.0.69?) </p> <p> deprecating and removing this var are two things, this change in the header goes straight to "unannounced removal". </p> <p> for the boost fix: is {{<span class="underline">CUDACC_VER_MAJOR/MINOR/BUILD</span>}} also available since CUDA 7.5? (I think yes.) </p> </description> <category>Ticket</category> </item> <item> <author>a.huebl@…</author> <pubDate>Wed, 09 Aug 2017 13:16:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13152#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13152#comment:3</guid> <description> <p> Are you sure you are using the official CUDA 9 RC (9.0.69) and not an older, early-access version? Or already a further update available since last week, 9.0.103? </p> </description> <category>Ticket</category> </item> <item> <author>a.huebl@…</author> <pubDate>Wed, 09 Aug 2017 13:40:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13152#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13152#comment:4</guid> <description> <p> The issue appeared in the 2nd RC, CUDA 9.0.103. </p> <p> the OP and me opened tickets with nvidia in </p> <blockquote> <p> <a class="ext-link" href="https://developer.nvidia.com/nvidia_bug/1971621"><span class="icon">​</span>https://developer.nvidia.com/nvidia_bug/1971621</a> <a class="ext-link" href="https://developer.nvidia.com/nvidia_bug/1971623"><span class="icon">​</span>https://developer.nvidia.com/nvidia_bug/1971623</a> </p> </blockquote> <p> and are hoping the the define will be "deprecated" first for a release, so not all previous and current boost releases are rendered broken. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 11 Oct 2017 06:24:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13152#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13152#comment:5</guid> <description> <p> Was this error resolved somehow? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 24 Nov 2017 10:33:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13152#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13152#comment:6</guid> <description> <p> Is there any update on the issue? CUDA 9.0 is out, and no changes from the RC, it is still not working, NVIDIA as always avoiding dealing with issues. Is there a fix planned for this? I had to go back to an older version in order to be able to compile Caffe... </p> </description> <category>Ticket</category> </item> <item> <author>sean.happel@…</author> <pubDate>Wed, 03 Jan 2018 23:10:10 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/13152 https://svn.boost.org/trac10/ticket/13152 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost.patch</span> </li> </ul> <p> Potential patch </p> Ticket sean.happel@… Wed, 03 Jan 2018 23:10:27 GMT attachment set https://svn.boost.org/trac10/ticket/13152 https://svn.boost.org/trac10/ticket/13152 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cu</span> </li> </ul> <p> Example test code (fails to compile without patch) </p> Ticket sean.happel@… Wed, 03 Jan 2018 23:14:42 GMT <link>https://svn.boost.org/trac10/ticket/13152#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13152#comment:7</guid> <description> <p> I've just attached a potential patch, along with a short test program to showcase the bug. This is affecting multiple libraries, including caffe and tensorflow. Fedora 27 has centered on Boost 1.64, so this issue affects that distro's ability to do cuda development with the latest cuda version. I've submitted a bug request there &lt;<a class="ext-link" href="https://bugzilla.redhat.com/show_bug.cgi?id=1530828"><span class="icon">​</span>https://bugzilla.redhat.com/show_bug.cgi?id=1530828</a>&gt; requesting the patch be applied downstream, but it would be really nice if this could be fixed in a hotfix for boost itself. </p> <p> This link &lt;<a class="ext-link" href="https://devtalk.nvidia.com/default/topic/858355/cuda_version-in-7-5rc-and-taking-different-code-paths-depending-on-nvcc-version-and-or-c-11-suppor/"><span class="icon">​</span>https://devtalk.nvidia.com/default/topic/858355/cuda_version-in-7-5rc-and-taking-different-code-paths-depending-on-nvcc-version-and-or-c-11-suppor/</a>&gt; indicates that the MAJOR/MINOR macros have been available since at least CUDA 7.5, so I think the patch should be a drop-in replacement. </p> </description> <category>Ticket</category> </item> <item> <author>a.huebl@…</author> <pubDate>Tue, 23 Jan 2018 14:56:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13152#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13152#comment:8</guid> <description> <p> This issue is fixed for Boost 1.65.1+ </p> <p> Please see: <a class="ext-link" href="https://github.com/boostorg/config/pull/175"><span class="icon">​</span>https://github.com/boostorg/config/pull/175</a> </p> <p> Unfortunately, the define to an error in nvcc / the CUDA toolkit was not changed in the final release of CUDA 9.0... so you have to take a newer version of boost or patch your old release with the same diff as linked. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 31 Jul 2018 18:46:39 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13152#comment:9 https://svn.boost.org/trac10/ticket/13152#comment:9 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket