Index: clang/lib/Driver/ToolChains/Cuda.cpp =================================================================== --- clang/lib/Driver/ToolChains/Cuda.cpp +++ clang/lib/Driver/ToolChains/Cuda.cpp @@ -135,10 +135,7 @@ Candidates.emplace_back( Args.getLastArgValue(clang::driver::options::OPT_cuda_path_EQ).str()); } else if (HostTriple.isOSWindows()) { - for (const char *Ver : Versions) - Candidates.emplace_back( - D.SysRoot + "/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" + - Ver); + Candidates.emplace_back(llvm::sys::Process::GetEnv("CUDA_PATH")); } else { if (!Args.hasArg(clang::driver::options::OPT_cuda_path_ignore_env)) { // Try to find ptxas binary. If the executable is located in a directory