6

I've been trying to get CUDA working on my PC. I tried clean (re-)installing the latest drivers and CUDA as well as latest Visual Studio 2017 RC Build Tools. My operating system is Windows 10 (64-bit) build 14393.693, GPU is GTX 1060 6GB (Driver version 378.49), CUDA version 8.0.44.

I took a simple demo from one of the NVIDIA blogs and when I try to compile with "nvcc", I get "nvcc fatal: Host compiler targets unsupported OS". I setup my envrionment by opening a command prompt in the folder with the .cu file, then running "vcvars64" to add the 64-bit cl.exe to my environment variables. I also tried this with "vcvars32" and I get same result.

I can confirm that cl.exe will compile a "HelloWorld" C file.

talonmies
  • 70,661
  • 34
  • 192
  • 269
Sina Madani
  • 1,246
  • 3
  • 15
  • 27
  • I solved it by changing from 19.28.29333 `cl.exe` compiler (VS 2019) to 19.00.24215.1 (VS 2015) for x86. – cho_uc Jan 10 '21 at 19:24

1 Answers1

7

Try using a supported host compiler.

Edit: The question has since come up again and gotten a better answer here: Using CUDA with Visual Studio 2017

tera
  • 7,080
  • 1
  • 21
  • 32
  • 1
    so I need to use 2015 Build Tools instead? – Sina Madani Feb 02 '17 at 14:01
  • 1
    Yes, you need to. – tera Feb 02 '17 at 14:13
  • 2
    I couldn't find cl.exe in 2015 Build Tools so I tried uninstalling and when I try to reinstall the setup does nothing. I just don't see why cl.exe from 2017 would differ from 2015 as the error message is about the operating system. – Sina Madani Feb 02 '17 at 14:17
  • I have the same problem 7 months later. The liked thread does not help me to solve this problem. Where is the cl.exe (from the 2015 toolchain) located? – Zapnuk Sep 07 '17 at 13:06