Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 we canont use TVM_CXX_COMPILER_PATH because the runtime env.
tqchen marked this conversation as resolved.
Show resolved Hide resolved
# 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