FS#62931 - [cuda] host compiler <= gcc8

Attached to Project: Community Packages
Opened by bartus (bartoszek) - Tuesday, 18 June 2019, 12:41 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Sunday, 12 January 2020, 16:34 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 8
Private No

Details

Cuda requires gcc<=8 as the host compiler.
The current package uses `core:gcc` as host compiler which gets an update to v9.1
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Sunday, 12 January 2020, 16:34 GMT
Reason for closing:  Fixed
Additional comments about closing:  Please don't request reopening until you are sure this is a packaging problem.
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 19 June 2019, 07:41 GMT
Update to fix this is pushed. From some preliminary testing, it seems to work ok. We might have to downgrade the CUDA gcc to gcc8 if there are some unforeseen issues. I'll try compiling tensorflow, pytorch and blender against that to give us some coverage.
Comment by Jingbei Li (Petron) - Wednesday, 19 June 2019, 10:15 GMT
I believe including gcc8 in [community] is better since gcc9 is not officially supported by CUDA yet.
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 19 June 2019, 10:27 GMT
We've often made CUDA use more recent stuff than what is officially supported. If it works, it works. So far my compiles look promising. Sadly tensorflow is a 10h compile.
Comment by Magnus Boman (katt) - Wednesday, 19 June 2019, 10:34 GMT
Thank you for this fix, just built waifu2x-converter-cpp with CUDA support using the updated package and output is fine.
Comment by Jakub Klinkovský (lahwaacz) - Wednesday, 19 June 2019, 10:34 GMT
I'm getting this error with nvcc from cuda-10.1.168-3 using gcc-9.1.0-1 (works fine with gcc < 9):

/usr/include/c++/9.1.0/bits/stl_function.h(437): error #20: identifier "__builtin_is_constant_evaluated" is undefined

Edit: You can reproduce the error immediately if you try to compile the CUDA samples. This could be done even in the check() function in the PKGBUILD as a basic sanity check of the compiler.
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 19 June 2019, 11:02 GMT
Funnily enough, I actually did compile some samples and it was fine! Which sample is this?
Comment by Jakub Klinkovský (lahwaacz) - Wednesday, 19 June 2019, 12:54 GMT
There were a lot of them when I tried a parallel build, but the first one seems to be 0_simple/cudaTensorCoreGemm:

$ cd /tmp
$ cp -r /opt/cuda/samples/ .
$ cd samples/
$ make -j1
make[1]: Entering directory '/tmp/samples/0_Simple/simpleCooperativeGroups'
/opt/cuda/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o simpleCooperativeGroups.o -c simpleCooperativeGroups.cu
/opt/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o simpleCooperativeGroups simpleCooperativeGroups.o
mkdir -p ../../bin/x86_64/linux/release
cp simpleCooperativeGroups ../../bin/x86_64/linux/release
make[1]: Leaving directory '/tmp/samples/0_Simple/simpleCooperativeGroups'
make[1]: Entering directory '/tmp/samples/0_Simple/cudaTensorCoreGemm'
/opt/cuda/bin/nvcc -ccbin g++ -I../../common/inc -m64 -maxrregcount=255 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o cudaTensorCoreGemm.o -c cudaTensorCoreGemm.cu
/usr/include/c++/9.1.0/bits/stl_function.h(437): error: identifier "__builtin_is_constant_evaluated" is undefined

1 error detected in the compilation of "/tmp/tmpxft_000015ce_00000000-7_cudaTensorCoreGemm.compute_75.cpp1.ii".
make[1]: *** [Makefile:302: cudaTensorCoreGemm.o] Error 1
make[1]: Leaving directory '/tmp/samples/0_Simple/cudaTensorCoreGemm'
make: *** [Makefile:51: 0_Simple/cudaTensorCoreGemm/Makefile.ph_build] Error 2
Comment by Pablo H.Cerdan (phcerdan) - Sunday, 12 January 2020, 15:10 GMT
cuda needs gcc8, try compile Gromacs for example: https://github.com/gromacs/gromacs

mkdir gromacs; cd gromacs;
git clone https://github.com/gromacs/gromacs src; mkdir build;
cd build;
cmake ../src;
make -j8;

error:
/usr/include/c++/9.2.0/bits/stl_function.h(437): error: identifier "__builtin_is_constant_evaluated" is undefined
Comment by Sven-Hendrik Haase (Svenstaro) - Sunday, 12 January 2020, 15:12 GMT
cuda as it is in Arch right now IS using gcc8. In some cases, you'll have to explicitly tell your build system to actually use gcc8 as the host compiler. However, we correctly symlink gcc8 to be the default compiler in the cuda package.

What would you have me change?
Comment by Jakub Klinkovský (lahwaacz) - Sunday, 12 January 2020, 15:49 GMT
@phcerdan: I was able to build Gromacs just fine with cuda-10.2.89-2...

Loading...