Downgrade GCC to version 8 in order to support Nvidia Cuda

I’m trying to get Nvidia’s CUDA development tools to work on a Tumblweed installation following the directions in this forum post. It installs and works find with my current Nvidia Driver, but I’m unable to build the sample projects. I get the following:

markg@linux-lx1e:/usr/local/cuda-10.2/samples> sudo make
[sudo] password for root: 
make[1]: Entering directory '/usr/local/cuda-10.2/samples/0_Simple/simpleVoteIntrinsics_nvrtc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/usr/local/cuda-10.2/samples/0_Simple/simpleVoteIntrinsics_nvrtc'
make[1]: Entering directory '/usr/local/cuda-10.2/samples/0_Simple/asyncAPI'
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../common/inc  -m64    -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o asyncAPI.o -c
In file included from /usr/local/cuda/bin/../targets/x86_64-linux/include/cuda_runtime.h:83,
                 from <command-line>:
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported!
  138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported!
      |  ^~~~~
make[1]: *** [Makefile:296: asyncAPI.o] Error 1
make[1]: Leaving directory '/usr/local/cuda-10.2/samples/0_Simple/asyncAPI'
make: *** [Makefile:51: 0_Simple/asyncAPI/Makefile.ph_build] Error 2

Can I downgrade from gcc version 9.2.1? If yes, what steps do I need to take? What problems with other applications might I expect to see?

Thanks for your help!

Just install gcc7 and use update-alternatives to switch as required, have a read here:

I also had to gcc7-c++, but after that, I’m able to compile the samples.

Thank you for your assistance!