make error on samples CUDA 10.0.13 nvidia-driver-410 ubuntu 18.10

Successfully installed CUDA 10(.deb local) but it installed gcc-8 as dependency as you can see below

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  build-essential cuda-10-0 cuda-command-line-tools-10-0 cuda-compiler-10-0 cuda-cupti-10-0 cuda-demo-suite-10-0 cuda-documentation-10-0 cuda-drivers cuda-nvcc-10-0 cuda-runtime-10-0 cuda-samples-10-0
  cuda-toolkit-10-0 cuda-tools-10-0 dkms g++ g++-8 gcc gcc-8 nvidia-dkms-410 nvidia-driver-410
Suggested packages:
  menu g++-multilib g++-8-multilib gcc-8-doc libstdc++6-8-dbg gcc-multilib autoconf automake libtool flex bison gcc-doc gcc-8-multilib gcc-8-locales libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg
  libasan5-dbg liblsan0-dbg libtsan0-dbg libubsan1-dbg libmpx2-dbg libquadmath0-dbg
The following NEW packages will be installed:
  build-essential cuda cuda-10-0 cuda-command-line-tools-10-0 cuda-compiler-10-0 cuda-cupti-10-0 cuda-demo-suite-10-0 cuda-documentation-10-0 cuda-drivers cuda-nvcc-10-0 cuda-runtime-10-0 cuda-samples-10-0
  cuda-toolkit-10-0 cuda-tools-10-0 dkms g++ g++-8 gcc gcc-8 nvidia-dkms-410 nvidia-driver-410
0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.1 MB/156 MB of archives.
After this operation, 580 MB of additional disk space will be used.

After installation

NVRM version: NVIDIA UNIX x86_64 Kernel Module  410.73  Sat Oct 20 22:12:33 CDT 2018
GCC version:  gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)

nvcc -V output

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130

Tried to run make on the samples after this but it throws the following error saying unsupported compiler, nothing later than 7 supported as shown below

/usr/local/cuda-10.0/bin/../targets/x86_64-linux/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!
  ^~~~~
make[1]: *** [Makefile:288: simpleZeroCopy.o] Error 1

Any fix?

Thank You

Ubuntu 18.10 isn’t a supported OS for CUDA. I guess you are trying to use the Ubuntu 18.04 deb local installer here.

Refer to the linux install guide:

[url]https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements[/url]

You should be able to use Ubuntu 18.04 as your OS instead.

Alternatively, you could try the runfile installer on Ubuntu 18.10, but I don’t know if that will work either. (and you would need to “clean out” the old install - refer to the linux install guide)

Finally, in your current setup, you should be able to manually build a gcc 7.x version that will work with CUDA 10 and at least may get you past this issue (although there may be other compatibility problems with Ubuntu 18.10). If you manually build a gcc 7.x version, just make sure that version gets selected first on your PATH, and you should be able to build the samples. There are many instructions available on the web concerning how to “downgrade” your installed GCC version.

Instead of building your own GCC, you may also be able to install an available gcc-7 package (set) on Ubuntu 18.10:

[url]https://www.ubuntuupdates.org/package/core/cosmic/universe/base/gcc-7[/url]

the answer here shows how:

[url]When will GCC be updated in 16.04 and 18.04? - Ask Ubuntu

“To install gcc-7 in Ubuntu 17.10, 18.04 and 18.10 …”

You are right, I did use the 18.04 deb local installer and it installed it with gcc-8 even after purging it.

Tried run-installer but it fails.

Tried adding symbolic links for gcc to use gcc-7 but it still gave the same error.

Since the upgrade from 18.04 to 18.10 is not really reversible any timeline on support for 18.10 or if at all its going to be looked at.

Purging gcc-8 after CUDA install leads to CUDA being uninstalled due to dependency created during installation.

Thank You!

Then you didn’t do it correctly. I’ve used alternate gcc many times, and it works fine. If it is still failing, it is because your symbolic link is not steering the build to use the correct GCC version.

I wouldn’t be able to comment on future, unreleased products or software, or schedules or timelines. That’s not my role, nor is it the primary purpose for these forums, with respect to NVIDIA communication on the forums.

Currently, Ubuntu 18.10 is not officially supported, which means CUDA 10.0 was never intended to work with Ubuntu 18.10 and it was never tested in that scenario.

My guess is that the package has a dependency on “gcc” and without further clarification, is pulling in the latest gcc for the platform. On Ubuntu 18.04 that works, because latest is gcc 7.3. On Ubuntu 18.10 it’s pulling in the wrong version. Again, was never tested that way, and never intended to be workable with 18.10.

Roger that, it was my fault. Forgot to add symbolic links to g++.

Seems to be working fine for now!

Thank You!