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

changes for spack #28

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion third_party/tsl/tsl/platform/default/rocm_rocdl_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ string RocmRoot() {
#endif
}

string RocdlRoot() { return io::JoinPath(RocmRoot(), "amdgcn/bitcode"); }
string RocdlRoot() {
if (const char* device_lib_path_env = std::getenv("HIP_DEVICE_LIB_PATH")) {
return device_lib_path_env;
}
else{
return io::JoinPath(RocmRoot(), "amdgcn/bitcode");
}
}

} // namespace tsl
8 changes: 7 additions & 1 deletion xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,13 @@ absl::StatusOr<std::vector<uint8_t>> EmitModuleToHsaco(
ir_fs->flush();
}
// Locate lld.
std::string lld_path = tsl::io::JoinPath(tsl::RocmRoot(), "llvm/bin");
std::string lld_path;
if (std::getenv("LLVM_PATH")) {
lld_path = tsl::io::JoinPath(std::getenv("LLVM_PATH"), "bin");
}
else{
lld_path = tsl::io::JoinPath(tsl::RocmRoot(), "llvm/bin");
}
auto lld_program = llvm::sys::findProgramByName("ld.lld", {lld_path});
if (!lld_program) {
return xla::Internal("unable to find ld.lld in PATH: %s",
Expand Down
Loading