Skip to content

Commit 1d6956a

Browse files
mroddenGoogle-ML-Automation
authored andcommitted
PR #27498: [ROCm] Add new hip_runtime bazel target
Imported from GitHub PR #27498 In the jaxlib extension for ROCm, we need to link to the HIP runtime (libamdhip64.so) but without the extra links that are on rocm_hip, such as comgr, rocm-smi, and HSA runtime (which are linked by libamdhip itself) Comgr shouldn't be directly linked by any HIP users either, but that hasn't been an issue for others apparently, so add this target that we can use from jaxlib and not intefere with rocm_hip. Copybara import of the project: -- 82a3ab3 by Mathew Odden <[email protected]>: [ROCm] Add new hip_runtime bazel target In the jaxlib extension for ROCm, we need to link to the HIP runtime (libamdhip64.so) but without the extra links that are on rocm_hip, such as comgr, rocm-smi, and HSA runtime (which are linked by libamdhip itself) Comgr shouldn't be directly linked by any HIP users either, but that hasn't been an issue for others apparently, so add this target that we can use from jaxlib and not intefere with rocm_hip. Merging this change closes #27498 COPYBARA_INTEGRATE_REVIEW=#27498 from mrodden:rocm-add-hip-runtime-target 82a3ab3 PiperOrigin-RevId: 770082371
1 parent 2df56ba commit 1d6956a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

third_party/gpus/rocm/BUILD.tpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,24 @@ cc_library(
180180
],
181181
)
182182

183+
# Used by jax_rocm_plugin to minimally link to hip runtime.
184+
cc_library(
185+
name = "hip_runtime",
186+
visibility = ["//visibility:public"],
187+
hdrs = glob(["%{rocm_root}/include/hip/**"]),
188+
srcs = glob(["%{rocm_root}/lib/libamdhip*.so"]),
189+
include_prefix = "rocm",
190+
includes = [
191+
"%{rocm_root}/include",
192+
],
193+
strip_include_prefix = "%{rocm_root}",
194+
deps = [
195+
":rocm_config",
196+
":rocprofiler_register",
197+
":system_libs",
198+
],
199+
)
200+
183201
cc_library(
184202
name = "rocblas",
185203
hdrs = glob(["%{rocm_root}/include/rocblas/**"]),

0 commit comments

Comments
 (0)