Skip to content
Open
Changes from all commits
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
14 changes: 14 additions & 0 deletions third_party/amd/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,20 @@ def path_to_rocm_lld():
lld = Path(lld_env_path)
if lld.is_file():
return lld
# Check ROCM_PATH environment variable
rocm_path = os.getenv("ROCM_PATH")
if rocm_path is not None:
lld = Path(rocm_path) / "llvm/bin/ld.lld"
if lld.is_file():
return lld
# Try rocm-sdk command
try:
sdk_root = subprocess.check_output(["rocm-sdk", "path", "--root"], text=True).strip()
lld = Path(sdk_root) / "llvm/bin/ld.lld"
if lld.is_file():
return lld
except (FileNotFoundError, subprocess.CalledProcessError):
pass
# Check backend for ld.lld (used for pytorch wheels)
lld = Path(__file__).parent / "llvm/bin/ld.lld"
if lld.is_file():
Expand Down
Loading