ROCm-enabled LLVM looks for supporting files under /opt/rocm
While attempting to use Guix-HPC's ROCm/HIP packages on a cluster that has MI50 GPUs (Grid'5000), I noticed that files were being searched for under /opt/rocm
, which may or may not work. From strace hpcg ...
:
newfstatat(AT_FDCWD, "lib/clang/17.0.0/lib/amdgcn-amd-amdhsa", 0x7ffe355d3ba0, 0) = -1 ENOENT (No such file or director
y)
newfstatat(AT_FDCWD, "../lib/amdgcn-amd-amdhsa", 0x7ffe355d3ba0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/gnu/store/ar7rkp30kx2wngqcqjw6a75m0g6rw3l8-clang-runtime-rocm-5.7.1/lib/amdhsa/amdgcn", 0x7ffe35
5d3ba0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 6
newfstatat(6, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
getdents64(6, 0x5618a72fab20 /* 7 entries */, 32768) = 192
getdents64(6, 0x5618a72fab20 /* 0 entries */, 32768) = 0
close(6) = 0
newfstatat(AT_FDCWD, "lib/clang/17.0.0", 0x7ffe355d3d70, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/opt/rocm", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
openat(AT_FDCWD, "/opt/rocm/share/hip/version", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/rocm/bin/.hipVersion", O_RDONLY|O_CLOEXEC) = 6
readlink("/proc/self/fd/6", "/opt/rocm-4.5.0/hip/bin/.hipVers"..., 4096) = 35
newfstatat(6, "", {st_mode=S_IFREG|0644, st_size=220, ...}, AT_EMPTY_PATH) = 0
pread64(6, "# Auto-generated by cmake\nHIP_PA"..., 220, 0) = 220
rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0
close(6) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
newfstatat(AT_FDCWD, "lib/clang/17.0.0/lib/amdgcn/bitcode", 0x7ffe355d4090, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "amdgcn/bitcode", 0x7ffe355d4090, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "amdgcn/bitcode", 0x7ffe355d4090, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "lib/clang/17.0.0/amdgcn/bitcode", 0x7ffe355d4090, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/opt/rocm/amdgcn/bitcode", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
openat(AT_FDCWD, "/opt/rocm/amdgcn/bitcode", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 6
This appears to come from llvm-rocm
, notably clang/lib/Driver/ToolChains/AMDGPU.cpp
.
@x-TGibso, @x-KHauge: shouldn't we patch these so that they are always found (and taken from Guix)?
Cc: @fpruvost