Ask Your Question

How to install or compile GCC 7.3 for CUDA 10 in Fedora 29?

asked 2018-11-08 15:54:01 -0500

why2 gravatar image

Since Fedora 28, the OS install GCC 8.X version. How can I install or compile GCC 7.3 in Fedora 29? I got such an error after trying to compile an open source project:

/usr/local/cuda-10.0/include/crt/host_config.h:129:2: error: #error -- unsupported GNU version! gcc versions later than 7 are not supported!
#error -- unsupported GNU version! gcc versions later than 7 are not supported!

I've read this GCC documentation However, I still cannot understand everything.

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted

answered 2019-03-04 13:57:13 -0500

why2 gravatar image

The solution from Bob Steagall with his gcc-builder works very well because the latest GCC won't be uninstalled and I can even switch multiple GCC versions I need. I found these two articles are very useful:

edit flag offensive delete link more



That's not needed. The new CUDA Toolkit 10.1 was released one week ago and supports GCC 8.x natively. The Fedora installer also defaults to Fedora 29:

vmercuri gravatar imagevmercuri ( 2019-03-05 20:42:08 -0500 )edit

Thanks for the information @vmercuri. But well the possibility to install and switch the GCC version will be still useful for the next Fedora releases since the Nvidia support is not really up-to-date or sync to the Fedora release.

why2 gravatar imagewhy2 ( 2019-03-07 04:00:28 -0500 )edit

True. At the current pace CUDA seems to support every other release of Fedora by the way: F25 -> F27 -> F29, so F31 will very possibly be the next. I personally also need to use that toolkit, so I tend to stick with the officially supported release. The reason is, while GCC is the main required component, CUDA is tested against the whole system and libraries that come with the distribution, GLIBC included, so I tend to just stay with the release of Fedora that is officially supported in order to avoid any possible annoyance.

vmercuri gravatar imagevmercuri ( 2019-03-07 06:01:33 -0500 )edit

ah good to know that CUDA support only for the uneven releases. I was waiting for the CUDA support after updated to F28 :(.

why2 gravatar imagewhy2 ( 2019-03-07 07:14:17 -0500 )edit

That's the current trend, not a rule :) I don't think there's any plan about supporting uneven releases, it's just that their release schedule meets Fedora's schedule in that fashion. But we should not assume this to be always true, let's just check their website to make sure which Fedora they currently support : )

vmercuri gravatar imagevmercuri ( 2019-03-07 08:00:02 -0500 )edit

answered 2019-03-04 18:59:24 -0500

revolucion09 gravatar image

Hi, its weird. latest CUDA i've installed (10.1) works fine with GCC 8 provided by Fedora (I use it to enable GPU on Blender). Maybe 10 was still compiled with GCC 7?

In any case, this article here: suggests using devtools-7. Check it out

edit flag offensive delete link more

answered 2018-11-11 06:28:59 -0500

Modus gravatar image

You can use the newer gcc v8.X, by passing the —override option to the .run file (assuming you downloaded the .run file for CUDA installation from the NVIDIA website). Otherwise if you have already installed as pointed in the other answer you can gcc-compat* to install the older version of gcc.

edit flag offensive delete link more


Just out of curiosity, are you sure cuda will eventually compile with newest gcc? My experience says "no way".

ed209 gravatar imageed209 ( 2018-11-11 08:32:31 -0500 )edit

I installed CUDA on my system couple of days ago, by running the .run file downloaded from NVIDIA with the flag —override and it installed it successfully and tested one of the sample apps that come with CUDA and worked fine.

Modus gravatar imageModus ( 2018-11-11 08:49:43 -0500 )edit
Modus gravatar imageModus ( 2018-11-11 08:51:00 -0500 )edit

You're talking about a beta. Moreover I would like to see something with cuda compiled by the latest gcc, not just the samples directory.

ed209 gravatar imageed209 ( 2018-11-11 13:41:54 -0500 )edit

I tried it last time, but the .run file threw errors at step 1.6.

why2 gravatar imagewhy2 ( 2019-03-04 14:01:56 -0500 )edit

answered 2018-11-08 17:53:18 -0500

ed209 gravatar image

Try installing older gcc version with

dnf install gcc-compat*
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-11-08 15:54:01 -0500

Seen: 2,177 times

Last updated: Mar 04 '19