[Windows][CUDA] Error: Host Compiler Targets Unsupported OS


#1

I am trying to run TVM on Windows with CUDA enabled. I have gotten it to build successfully. When running a simple model, however, codegen fails with the following error:

RuntimeError: Compilation error:
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.24610 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

tmpxft_00114ecc_00000000-1.cpp
nvcc fatal   : Host compiler targets unsupported OS.

I have a Tesla M4, driver version 425.25, and CUDA 10.1. I am using Visual Studio 2017. The CMake files are generated with the following string:

cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release - DCMAKE_CONFIGURATION_TYPES="Release" ..

Would anyone be able to provide some guidance?


#2

I was able to figure this out. It turns out nvcc uses whichever cl.exe is first in the PATH, rather than the one that TVM was built with. There was a cl.exe for a different architecture earlier in the PATH than the cl.exe that I wanted. I updated the PATH environment variable to put the right cl.exe first.