Ethminer: CUDA 9.0 unsupported gcc versions later than 6

Created on 12 Feb 2018  路  20Comments  路  Source: ethereum-mining/ethminer

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 ?

Most helpful comment

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.

All 20 comments

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

@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 :)

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/

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

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

It will build using gcc-5.

it doesn't seem like this should be closed

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

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

@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.

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.

@RustyRaptor Great solution. Worked for me.

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

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

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

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

E: Unable to locate package gcc-6
(

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

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.

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bartocc picture bartocc  路  3Comments

gennadiv picture gennadiv  路  5Comments

RJBetancor picture RJBetancor  路  5Comments

sur1v picture sur1v  路  4Comments

nguylb73 picture nguylb73  路  3Comments