CUDA compatibility issue with gcc

Hello everyone,

I’ve been trying to activate CUDA rendering on my Fedora 25 computer but it’s not working bc aparently CUDA 8 is not compatible with the pre installed gcc 6. Is there any other way to make it work besides downgrading gcc? :confused:

/usr/local/cuda/bin/..//include/host_config.h:119:2: Fehler: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
CUDA kernel compilation failed, see console for details.

And if not: Does anyone have a manual for beginners on how to install two gcc versions parallel? :S

Thanks!

I don’t know the compilations flags, but it is doable. I’m on Arch with CUDA 8 and gcc 6.2.1-1 working. Mind you, I also have gcc 5.4.0-1 installed, so maybe that’s the workaround. You don’t need to downgrade gcc, you can install gcc 5 alongside gcc 6.

Possibly have a look at the Arch PKGBUILD files for clues:

https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/gcc-multilib
https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/gcc5

that has been a problem with fedora since i first used fedora core 4 many many years ago

fedora is by it’s own definition the newest of the new

for using the CUDA-sdk you will almost always have to use a DEAD AND UNSUPPORTED version of fedora
( NOT RECOMMENDED!!!)

however ALL nvidia drivers for the current cards support CUDA
BUT Fedora DEFAULTS to the “Nouveau” driver – non cuda

welcome to the WORLD of Fedora

you will find that it is SO NEW that even 6 month old code will NEED to be hacked to use the very very very new versions of gcc and libs and other NEW versions of programs

that and having to reinstall fedora EVERY 6 months is why i finally got off the fedora roller coaster
and moved to OpenSUSE

And if not: Does anyone have a manual for beginners on how to install two gcc versions parallel? :S

as far as i know fedora repos do NOT supply older versions of gcc ( other than “gcc34-compt” )

YOU have to build it from source

then set "alternatives " in fedora to point to the different version

or
go “old school” like i do
with shell scripts that remove and relink links to the different versions

an example
– WARNING!!! USE CAUTION!!!
to set 4.8 on MY SYSTEM


#!/bin/bash

rm /usr/bin/cpp
ln -s /usr/bin/cpp-4.8 /usr/bin/cpp
echo ln -s cpp-4.8 cpp

rm /usr/bin/cc
ln -s /usr/bin/gcc-4.8 /usr/bin/cc
echo ln -s gcc-4.8 cc

rm /usr/bin/gcc
ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
echo ln -s gcc-4.8 gcc

rm /usr/bin/c++
ln -s /usr/bin/g++-4.8 /usr/bin/c++
echo ln -s g++-4.8 c++

rm /usr/bin/g++
ln -s /usr/bin/g++-4.8 /usr/bin/g++
echo ln -s g++-4.8 g++

rm /usr/bin/gcov
ln -s /usr/bin/gcov-4.8 /usr/bin/gcov
echo ln -s gcov-4.8 gcov

rm /usr/bin/gfortran
ln -s /usr/bin/gfortran-4.8 /usr/bin/gfortran
echo ln -s gfortran-4.8 gfortran