title: The CUDA compiler is not able to compile a simple test program
body: <p>I created a template Clion project in CUDA and it does not seem to work at all.</p>
  <p><a href="https://i.stack.imgur.com/AeuTa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AeuTa.png" alt="Clion new projct creation" /></a></p>
  <p>The only thing which I changed is this line in <code>CMakeLists.txt</code>:</p>
  <pre><code>set(CMAKE_CUDA_COMPILER &quot;/usr/local/cuda-10.1/bin/nvcc&quot;)
  </code></pre>
  <p>So it looks like this:</p>
  <pre><code>cmake_minimum_required(VERSION 3.17)
  
  set(CMAKE_CUDA_COMPILER &quot;/usr/local/cuda-10.1/bin/nvcc&quot;)
  project(test CUDA)
  
  set(CMAKE_CUDA_STANDARD 14)
  
  add_executable(test main.cu)
  
  set_target_properties(
          test
          PROPERTIES
          CUDA_SEPARABLE_COMPILATION ON)
  </code></pre>
  <p>It does not matter if I try to build the program from Clion or terminal, I always get:</p>
  <pre><code>CMake Error at /snap/clion/129/bin/cmake/linux/share/cmake-3.17/Modules/CMakeTestCUDACompiler.cmake:46 (message):
    The CUDA compiler
  
      &quot;/usr/local/cuda-10.1/bin/nvcc&quot;
  
    is not able to compile a simple test program.
  
    It fails with the following output:
  
      Change Dir: /home/user/CLionProjects/test/cmake-build-debug/CMakeFiles/CMakeTmp
      
      Run Build Command(s):/usr/bin/make cmTC_bafff/fast &amp;&amp; /usr/bin/make  -f CMakeFiles/cmTC_bafff.dir/build.make CMakeFiles/cmTC_bafff.dir/build
      make[1]: Entering directory '/home/user/CLionProjects/test/cmake-build-debug/CMakeFiles/CMakeTmp'
      Building CUDA object CMakeFiles/cmTC_bafff.dir/main.cu.o
      /usr/local/cuda-10.1/bin/nvcc     -x cu -c /home/user/CLionProjects/test/cmake-build-debug/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_bafff.dir/main.cu.o
      In file included from /usr/local/cuda-10.1/bin/../targets/x86_64-linux/include/cuda_runtime.h:83,
                       from &lt;command-line&gt;:
      /usr/local/cuda-10.1/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]: *** [CMakeFiles/cmTC_bafff.dir/build.make:86: CMakeFiles/cmTC_bafff.dir/main.cu.o] Error 1
      make[1]: Leaving directory '/home/user/CLionProjects/test/cmake-build-debug/CMakeFiles/CMakeTmp'
      make: *** [Makefile:141: cmTC_bafff/fast] Error 2
          
  
    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:4 (project)
  
  
  -- Configuring incomplete, errors occurred!
  See also &quot;/home/user/CLionProjects/test/cmake-build-debug/CMakeFiles/CMakeOutput.log&quot;.
  See also &quot;/home/user/CLionProjects/test/cmake-build-debug/CMakeFiles/CMakeError.log&quot;.
  </code></pre>
  <p>I use Ubuntu 20, Clion (2020.2.4) is from the newest snap. I also tried to run it with different versions of gcc and g++ (7, 8 and 9) and CMake (3.17 (snap), 3.18 and 3.19).
  Additionally:</p>
  <ul>
  <li>Nvidia driver version: 455.23.0</li>
  <li>CUDA Version: 11.1</li>
  </ul>
  <p>The path <code>/usr/local/cuda-10.1/bin/nvcc</code> is correct.</p>