Opened 5 years ago

Closed 4 years ago

#13152 closed Bugs (fixed)

nvcc Error: Boost 1.64.0 & CUDA 9.0

Reported by: Alexander Korsunsky <a.korsunsky@…> Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.64.0 Severity: Showstopper
Keywords: cuda, nvcc Cc: a.korsunsky@…

Description

Compilation of files that include Boost fail with the CUDA Toolkit version 9.

The reason for that is that at boost/config/compiler/nvcc.hpp, line 22 and 26 you use the macro __CUDACC_VER__ for version checking, but the symbol has been deprecated in CUDA 9.

Line 64 in crt/common_functions.h of the CUDA toolkit now reads:

#define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported.  Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."

The fix seems simple enough, instead of checking for the whole version, you could check separately for __CUDACC_VER_MAJOR__ and __CUDACC_VER_MINOR__ .

Attachments (2)

boost.patch (896 bytes ) - added by sean.happel@… 5 years ago.
Potential patch
main.cu (56 bytes ) - added by sean.happel@… 5 years ago.
Example test code (fails to compile without patch)

Download all attachments as: .zip

Change History (11)

comment:1 by Alexander Korsunsky <a.korsunsky@…>, 5 years ago

Cc: a.korsunsky@… added

comment:2 by a.huebl@…, 5 years ago

migrated comment from github:

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?)

deprecating and removing this var are two things, this change in the header goes straight to "unannounced removal".

for the boost fix: is {{CUDACC_VER_MAJOR/MINOR/BUILD}} also available since CUDA 7.5? (I think yes.)

comment:3 by a.huebl@…, 5 years ago

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?

comment:4 by a.huebl@…, 5 years ago

The issue appeared in the 2nd RC, CUDA 9.0.103.

the OP and me opened tickets with nvidia in

https://developer.nvidia.com/nvidia_bug/1971621 https://developer.nvidia.com/nvidia_bug/1971623

and are hoping the the define will be "deprecated" first for a release, so not all previous and current boost releases are rendered broken.

comment:5 by anonymous, 5 years ago

Was this error resolved somehow?

comment:6 by anonymous, 5 years ago

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...

by sean.happel@…, 5 years ago

Attachment: boost.patch added

Potential patch

by sean.happel@…, 5 years ago

Attachment: main.cu added

Example test code (fails to compile without patch)

comment:7 by sean.happel@…, 5 years ago

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 <https://bugzilla.redhat.com/show_bug.cgi?id=1530828> requesting the patch be applied downstream, but it would be really nice if this could be fixed in a hotfix for boost itself.

This link <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/> 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.

comment:8 by a.huebl@…, 5 years ago

This issue is fixed for Boost 1.65.1+

Please see: https://github.com/boostorg/config/pull/175

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.

comment:9 by John Maddock, 4 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.