Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

CUDA 9.0 unsupported gcc versions later than 6 #731

Closed
Rodriguevb opened this issue Feb 12, 2018 · 21 comments
Closed

CUDA 9.0 unsupported gcc versions later than 6 #731

Rodriguevb opened this issue Feb 12, 2018 · 21 comments

Comments

@Rodriguevb
Copy link

Following these steps :

  • Use virtualbox and install Ubuntu Server
  • git clone this repo
  • sudo ./scripts/install_cmake.sh
  • sudo ./scripts/install-cuda-ubuntu1604.sh (<<< install gcc-7)
  • /home/username/.local/bin/cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-9.0 .. -DETHASHCUDA=ON -DETHASHCL=OFF
  • /home/username/.local/bin/cmake --build .

And gets CMake Error unsupported GNU version! gcc versions later than 6 are not supported!
But the script install-cuda-ubuntu1604.sh install gcc-7.. What i need to do ?

@jean-m-cyr
Copy link
Contributor

@Rodriguevb I don't think the miner will work very well, if at all, in a virtualized environment.

@Rodriguevb
Copy link
Author

@jean-m-cyr No doesn't work, but i just want to compile ethminer with specific requirements like gcc version 6 max and then I transfer to my miner :)

@piotr-dobrogost
Copy link

piotr-dobrogost commented Feb 12, 2018

For what it's worth I managed to compile ethminer with CUDA 9.1 and gcc 7.2 on Fedora 27 making change described at https://davidwpearson.wordpress.com/2017/12/21/installing-nvidias-cuda-9-1-on-fedora-27/

@MariusVanDerWijden
Copy link
Collaborator

You can use -DCMAKE_C_COMPILER=/usr/bin/gcc-6 to specify the path of the compiler

@alkmim
Copy link

alkmim commented Feb 19, 2018

You can also use this Dockerfile: https://github.com/alkmim/ethminer-docker

It will build using gcc-5.

@StoneCypher
Copy link

it doesn't seem like this should be closed

i just set up a new ubuntu box and this appears to be a roadblock

@MariusVanDerWijden
Copy link
Collaborator

You need to download gcc-6 and use -DCMAKE_C_COMPILER=/usr/bin/gcc-6 to specify the path of the compiler. CUDA doesn't work with later gcc versions

@alkmim
Copy link

alkmim commented Apr 19, 2018

@StoneCypher Sorry for the question, but is there any reason why not use https://github.com/alkmim/ethminer-docker ?

Even using a new ubuntu box, you should be able to build ethminer using cuda9 driver.

@RustyRaptor
Copy link

guys just use

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 10

and

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10

I hope this helped.

@travis-cramer
Copy link

@RustyRaptor Great solution. Worked for me.

@askerlee
Copy link

@RustyRaptor thanks it works. Do I need to revert it to gcc7 after installation?

@RustyRaptor
Copy link

@askerlee you don't have to revert it unless you are going to compile a project that requires GCC7.

@Diyago
Copy link

Diyago commented Sep 10, 2018

update-alternatives: error: alternative path /usr/bin/gcc-6 doesn't exist
how can I fix that

@MariusVanDerWijden
Copy link
Collaborator

MariusVanDerWijden commented Sep 10, 2018

You have to install gcc-6
e.g. 'sudo apt-get install gcc-6'

@Diyago
Copy link

Diyago commented Sep 11, 2018

E: Unable to locate package gcc-6
(

@MariusVanDerWijden
Copy link
Collaborator

MariusVanDerWijden commented Sep 11, 2018

For Ubuntu xenial (16.04)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-6 g++-6

@RustyRaptor
Copy link

Yeah. I think everyone should just upgrade to 18.04 at this point. My coworker was having trouble with it too. It's a 2-year-old release now lol.

@pranavnijampurkar33
Copy link

All those who are still struggling even if applying above solutions. I followed above and still failed to remove issue. I tried script located in following ling . Hope it helps you....!!!!
https://gist.github.com/zuyu/7d5682a5c75282c596449758d21db5ed

@Zumbalamambo
Copy link

Zumbalamambo commented Aug 13, 2020

Give this man @RustyRaptor a Noble Prize on saving lives!!!!!!!!!!!!!

@lisa676
Copy link

lisa676 commented Sep 18, 2020

For those who are still facing this issue.
I was unable to solve my problem using above mentioned methods.
My system specification is

  • Python 3.7

  • CUDA 9, CuDNN 7.5 using RTX-2060

  • Ubuntu 18 having GCC/G++ 7.5

I solved my issue by using following method,

sudo apt remove gcc gcc-7 g++ g++-7
sudo apt install gcc-6 g++-6

and then using above mentioned commands

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10

@raywzy
Copy link

raywzy commented Oct 21, 2021

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10

Setting superiority doesn't work for me.
I solve the problem by this command,

sudo update-alternatives --config gcc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests