Nvidia CUDA req gcc7 but -current provides gcc8
I ran into a compilation issue with a tool that uses cuda and problem appears to be that cuda only supports up to gcc7. I modified the cuda source file that implements that restriction but later ran into other build issues that could also be due to gcc8.
I've found some info on running two different versions of gcc side-by-side. I'm unable to download the gcc7 Slackbuilds though, because -current has moved to gcc8. I'm not aware of any repo/archive that stores older versions/snapshots of the -current tree. I'll probably try to use the gcc8 Slackbuilds with gcc7 source and hopefully that will work. Thanks in advance for any other suggestions! |
Complain to NVIDIA is my suggestion.
|
They pick up my calls!
Quote:
|
Be happy. I am stuck with webkit2gtk-2.20.5 for Slint-14.2.1.2 based on Slackware-14.2, because more recent versions need GCC6. It's hard to please everybody...
As an aside this could be a concern as that prevents to benefit of further security fixes. But as long as we ship it only as a (private) dependency of yelp and not of a web browser that's OK, I think. |
Quote:
|
Can you use clang?
|
Thanks for the suggestions.
In the end I did a search for the older gcc 7.3.0 build 3 binary packages and found two sites that store older versions (I neither guarantee nor endorse them but it worked for me :) ). http://slackmirror.cbpf.br/pub/slackware/ http://ftp.pieskovisko.sk/slackware/ Downloaded and downgraded to these older packages: gcc-7.3.0-x86_64-3.txz gcc-brig-7.3.0-x86_64-3.txz gcc-g++-7.3.0-x86_64-3.txz gcc-gfortran-7.3.0-x86_64-3.txz gcc-gnat-7.3.0-x86_64-3.txz gcc-go-7.3.0-x86_64-3.txz gcc-objc-7.3.0-x86_64-3.txz Things seem to work fine for me now as far as the things I need to compile that don't work with gcc8. After I'm done compiling, I may upgrade back to the gcc 8 packages. |
It may be easier for you to just install GCC 7.3 from source. After downloading the source tarball, there is a script in-there to download prerequisites, and then I build it from source using following commands:
Code:
./configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu \ Code:
CC=/opt/gcc-7.3/bin/gcc-7.3 The advantage of this approach is that this way you don't mess with your system-wide GCC installation - you have parallel GCC 7 installation, that you could use only when needed. NVIDIA is indeed usually slow to enable latest GCC version. Previously, it was typically enough just to comment out corresponding #ifdef in specific CUDA header file to make it possible to use latest version of GCC, but with GCC 7 and GCC 8 things get more complicated. For GCC 7, there was a patch in ciruculation that will make CUDA work, but with GCC 8, there is no such thing, as far as I know, so the only way is to use GCC 7. Alike for LLVM, the highest clang version supported is 6, while Slackware switched to clang version 7. Next CUDA version will certainly fix this, as many important distributions switched to GCC 8, and in particular upcoming RHEL 8 should come with GCC 8 too. I expect new CUDA version certainly at the next GTC conference, in March 2019, and maybe earlier. |
@cgorac Thanks for the detailed guide! That looks like a promising approach. Compiling gcc 7.4.0 right now and will see how the CUDA piece works out once gcc is ready.
I did try downgrading the system gcc to 7.3.0 but that caused issues when I compiled the latest the Nvidia kernel modules (gcc mismatch with gcc 8 used to compile the kernel). So this parallel gcc 7 setup in /opt looks like a better way to go. |
Made good progress so far.
Compiled and installed gcc Notes:
Code:
# mkdir /usr/local/src/gcc Downloaded latest cuda 9.2 and cudnn packages (Ubuntu->installer runfile):
Symlink for gcc binary: Code:
# cd /opt/gcc/gcc-7.4/bin Code:
# PATH="/opt/gcc/gcc-7.4/bin:${PATH}" ./cuda_9.2.148_396.37_linux.run |
All times are GMT -5. The time now is 03:05 AM. |