Skip to content

Commit

Permalink
fix: linker issues in conda environments microsoft#3929
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegmd committed Aug 30, 2023
1 parent 57d629a commit a4950c3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion op_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,25 @@ def cxx_args(self):
import torch
args = []
if not self.build_for_cpu:
args += super().cxx_args()

if not self.is_rocm_pytorch():
CUDA_LIB64 = os.path.join(torch.utils.cpp_extension.CUDA_HOME, "lib64")
CUDA_LIB = os.path.join(torch.utils.cpp_extension.CUDA_HOME, "lib")
else:
CUDA_LIB64 = os.path.join(torch.utils.cpp_extension.ROCM_HOME, "lib")
CUDA_LIB = None

args += super().cxx_args()
args += [
f'-L{CUDA_LIB64}',
]

if CUDA_LIB is not None:
args += [
f'-L{CUDA_LIB}',
]

args += [
'-lcudart',
'-lcublas',
'-g',
Expand Down

0 comments on commit a4950c3

Please sign in to comment.