6

I'm trying to install the latest CUDA version from the official Nvidia website.

When running the sudo sh cuda_10.2.89_440.33.01_linux.run I get:

Failed to verify gcc version. See log at /var/log/cuda-installer.log for details.

When I cat the log file I get:

[ERROR]: unsupported compiler version: 9.3.0. Use --override to override this check.

I searched online and apparently some say that the latest CUDA installation cannot make use of the latest gcc version. Even so I tried to force the installation with the --overrideargument but it failed, and unfortunately I couldn't find out as the resulting log file was huge.

I then tried to install an older version of gcc, specifically version 8, via sudo apt install gcc-8, however I still have the latest gcc version, as gcc -vreturns:

> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
**gcc version 9.3.0** (Ubuntu 9.3.0-10ubuntu2) 
5
  • See askubuntu.com/questions/1222285/how-to-downgrade-to-gcc-7-3/… for using older compiler versions on CUDA.
    – ubfan1
    May 6, 2020 at 15:44
  • No, not really. The downgrade procedure is not really that well explained and the ultimate goal was to get cuda installed.
    – Nameless
    May 6, 2020 at 18:17
  • I can't speak to the runfile installation method, but you've installed the older gcc, so all you need is to add links into your $HOME/bin for gcc, ar, nm, and ranlib to these old versions. Changing the system compiler default for one application, CUDA, is just asking for trouble. After the install, the gcc... links can be put into the ...cuda/bin, wherever you installed it.
    – ubfan1
    May 6, 2020 at 18:43
  • @ubfan1 i am sorry but I don’t know how to do what you said. I know how to create sym links but I’m not that familiar with Ubuntu file system and paths. I come from macOS. For example, after I ran sudo install gcc 8 I have no idea where it was installed
    – Nameless
    May 6, 2020 at 21:49
  • Does this answer your question? What version of GCC is used by the make command?
    – karel
    May 6, 2020 at 23:41

2 Answers 2

4

According to this link link if you run these command

sudo apt -y install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8

you can install cuda toolkit

1

Add the four symlinks to /usr/local/cuda-10.2 (or wherever you install to):

/usr/local/cuda-10.1/bin/gcc -> /usr/bin/gcc-8  
/usr/local/cuda-10.1/bin/ar -> /usr/bin/gcc-ar-8  
/usr/local/cuda-10.1/bin/ranlib -> /usr/bin/gcc-ranlib-8  
/usr/local/cuda-10.1/bin/nm -> /usr/bin/gcc-nm-8

With a commands like:

sudo ln -s /usr/bin/gcc-8 /usr/local/cuda-10.1/bin/gcc  

Now with/usr/local/cuda-10.1/bin added to the start of your PATH, and usr/local/cuda-10.1/lib64 added to LD_LIBRARY_PATH, you should be able to run the make files on the samples and get a working demo. I make the PATH mods in my .profile, since I use bash.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .