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

Fix HIT.cmake handling of no architectures found #3206

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

msimberg
Copy link

When trying to install HIP on a system without any devices available (such as a login node without GPUs on a cluster) the CMake configuration fails in HIT.cmake like this:

-- CMAKE_TESTING_TOOL:
-- CMAKE HIP ARCHITECTURES: OFF
Traceback (most recent call last):
  File "/opt/rocm/bin/rocm_agent_enumerator", line 257, in <module>
    main()
  File "/opt/rocm/bin/rocm_agent_enumerator", line 241, in main
    target_list = readFromKFD()
  File "/opt/rocm/bin/rocm_agent_enumerator", line 193, in readFromKFD
    for node in sorted(os.listdir(topology_dir)):
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/kfd/kfd/topology/nodes/'
-- ROCm Agent Enumurator Result: 1
CMake Error at /tmp/simbergm/spack-stage/spack-stage-hip-5.4.3-6riler52zjomlj3yrpd3fntoq77twl2n/spack-src/tests/hit/HIT.cmake:49 (string):
  string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
  CMakeLists.txt:461 (include)


-- ROCm Agent Enumurator found no valid architectures
-- Configuring incomplete, errors occurred!

This is building HIP through spack (I can provide instructions to reproduce this if needed).

This PR fixes the call to string(REPLACE ...) to properly quote HIP_GPU_ARCH so that the call doesn't fail. Alternatively, or additionally, you could probably do something with the non-zero exit code of rocm_agent_enumerator, but I don't know if it can have a non-zero exit code but still list some architectures? So I haven't changed anything regarding that.

As a flyby this fixes some typos of "Enumurator".

…empty

CMake's string function fails if HIP_GPU_ARCH is empty, thinking that it
only received three arguments for the REPLACE sub-command.
@msimberg
Copy link
Author

Ping? Any comments on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant