From f00486c8f39731c494b53b7f2c13a77c0d4fcbb2 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sat, 27 Sep 2025 09:23:32 +0200 Subject: [PATCH] Fix HIP library detection The code unconditionally checked `lib`, but on modern Linux distributions, 64-bit binaries are under `lib64` instead. Note that this might be slightly different on Debian-based distributions, but as I don't have one I can't test it. --- modules/rocm.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/rocm.py b/modules/rocm.py index 3af8eb577..0222218c8 100644 --- a/modules/rocm.py +++ b/modules/rocm.py @@ -59,7 +59,13 @@ class ROCmEnvironment(Environment): super().__init__(lib) break else: - super().__init__(os.path.join(path, "lib", "libamdhip64.so")) + # Check 64bit path first, then fall back if it doesn't exist + # FIXME: This may be brittle on Debian-based distributions + joined_path = os.path.join(path, "lib64", "libamdhip64.so") + if not os.path.exists(joined_path): + joined_path = os.path.join(path, "lib", "libamdhip64.so") + + super().__init__(joined_path) self.path = path