Bug 1565375

Summary: Advanced C++ code which requires CUDA can't be built on RHEL7
Product: Red Hat Developer Toolset Reporter: Ben Woodard <woodard>
Component: gccAssignee: Marek Polacek <mpolacek>
Status: CLOSED NOTABUG QA Contact: Martin Cermak <mcermak>
Severity: high Docs Contact:
Priority: unspecified    
Version: DTS 7.1 RHEL 7CC: ernunes, jakub, kanderso, law, mcermak, mnewsome, ohudlick, tgummels
Target Milestone: alpha   
Target Release: 7.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-12 21:54:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Woodard 2018-04-09 23:54:26 UTC
Description of problem:
CUDA programs can't be build on RHEL7

We have a problemwith gcc versions though, using the RHEL7 gcc 4.8 gives:
CMake Error at cmake/SetupCompilers.cmake:54 (message):
 RAJA requires GCC 4.9 or greater!

And having CUDA enabled with the SCL latest gcc 7.2.1 gives the same as
the cuda samples:
/usr/local/cuda/include/crt/host_config.h:121:2: error: #error --
unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not
supported!
 ^~~~~

Several work arounds exist:
1) they can build their own RHEL6 compiler
2) they can continue to run DTS6 even though we have retired it.
3) You can work around some of those problems by adding  -Xcompiler "-std=c++03" to nvcc command line. I thought that -std=c++11 was supposed to work but for some reason it didn’t. 

It is important to LLNL that the advanced compilers work with CUDA.

Yes this primarily nvidia's issue but as we move forward enabling GPUs this is something that needs to work correctly.

Comment 3 Erico Nunes 2018-04-10 12:06:58 UTC
(In reply to Ben Woodard from comment #0)
> 3) You can work around some of those problems by adding  -Xcompiler
> "-std=c++03" to nvcc command line. I thought that -std=c++11 was supposed to
> work but for some reason it didn’t. 

In this case it's a preprocessor macro in the CUDA 9.1 headers, so I believe it is just an Nvidia issue:

/usr/local/cuda-9.1/targets/x86_64-linux/include/crt/host_config.h

119 #if __GNUC__ > 6
120 
121 #error -- unsupported GNU version! gcc versions later than 6 are not supported!
122 
123 #endif /* __GNUC__ > 6 */

Comment 5 Jeff Law 2018-07-12 21:54:11 UTC
This is really a problem with the NVidia CUDA headers.  There's really nothing we can do here.