Skip to content

Commit

Permalink
[NVCC] Bugfix nvcc command tool that relies on the compile time env (a…
Browse files Browse the repository at this point in the history
…pache#7964)

* [NVCC] Bugfix nvcc command tool that relies on the compile time env

* Update python/tvm/contrib/nvcc.py

Co-authored-by: Cody Yu <comaniac0422@gmail.com>

Co-authored-by: Cody Yu <comaniac0422@gmail.com>
  • Loading branch information
2 people authored and umangyadav committed May 5, 2021
1 parent b07b150 commit 445b6ea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python/tvm/contrib/nvcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +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")
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]
# NOTE: ccbin option can be used to 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.
# However, we cannot use TVM_CXX_COMPILER_PATH because the runtime env.
# Because it is hard to do runtime compiler detection, we require nvcc is configured
# correctly by default.
# if cxx_compiler_path != "":
# cmd += ["-ccbin", cxx_compiler_path]

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

Expand Down

0 comments on commit 445b6ea

Please sign in to comment.