NVCC - host compiler targets unsupported OS [duplicate]
Asked Answered
C

1

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.

Castellano answered 2/2, 2017 at 13:46 Comment(1)
I solved it by changing from 19.28.29333 cl.exe compiler (VS 2019) to 19.00.24215.1 (VS 2015) for x86.Boiler
G
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

Garett answered 2/2, 2017 at 13:55 Comment(4)
so I need to use 2015 Build Tools instead?Castellano
Yes, you need to.Garett
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.Castellano
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?Impresario

© 2022 - 2024 — McMap. All rights reserved.