Skip to content

Commit

Permalink
[NVCC] Bugfix nvcc command tool that relies on the compile time env
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed May 2, 2021
1 parent f4a680d commit cc0dfcd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/tvm/contrib/nvcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ def compile_cuda(code, target="ptx", arch=None, options=None, path_target=None):
cmd += ["-o", file_target]
cmd += [temp_code]

cxx_compiler_path = tvm.support.libinfo().get("TVM_CXX_COMPILER_PATH")
# TODO(tvm-team): consider add cxx compiler path detection for windows
# Tell nvcc where to find the c++ compiler just in case it is not in the path.
# On Windows it is not in the path by default.
# NOTE: we canont use TVM_CXX_COMPILER_PATH because the runtime env can be different
# from the compilation env.
cxx_compiler_path = ""
if cxx_compiler_path != "":
# This tells nvcc where to find the c++ compiler just in case it is not in the path.
# On Windows it is not in the path by default.
cmd += ["-ccbin", cxx_compiler_path]

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
Expand Down

0 comments on commit cc0dfcd

Please sign in to comment.