[ERROR]: unsupported compiler version: 9.3.0 when installing CUDA on 20.04

8,562

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

Share:
8,562

Related videos on Youtube

Nameless
Author by

Nameless

Updated on September 18, 2022

Comments

  • Nameless
    Nameless over 1 year

    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) 
    
    • ubfan1
      ubfan1 about 4 years
      See askubuntu.com/questions/1222285/how-to-downgrade-to-gcc-7-3/‌​… for using older compiler versions on CUDA.
    • Nameless
      Nameless about 4 years
      No, not really. The downgrade procedure is not really that well explained and the ultimate goal was to get cuda installed.
    • ubfan1
      ubfan1 about 4 years
      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.
    • Nameless
      Nameless about 4 years
      @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
    • karel
      karel about 4 years
      Does this answer your question? What version of GCC is used by the make command?