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

Issue about compiling Ginkgo with rocm 6.0 #1529

Closed
tpadioleau opened this issue Jan 16, 2024 · 8 comments
Closed

Issue about compiling Ginkgo with rocm 6.0 #1529

tpadioleau opened this issue Jan 16, 2024 · 8 comments
Assignees
Labels
is:bug Something looks wrong. mod:hip This is related to the HIP module. reg:build This is related to the build system.

Comments

@tpadioleau
Copy link

tpadioleau commented Jan 16, 2024

I recently had trouble compiling Ginkgo 1.6 with rocm 6.0. At first I had an issue with cmake that could not find a function called hip_add_library. After setting CMAKE_MODULE_PATH, I encountered /opt/rocm/hip/../llvm/bin/clang: not found because the directory hip does not exist in /opt/rocm. After creating this directory, I encountered

/ginkgo/hip/base/types.hip.hpp:46:10: fatal error: 'hipblas.h' file not found
#include <hipblas.h>

Are you aware of such problems ?

I attach two docker files, one that builds fine with rocm 5.7.3 (Dockerfile-rocm5.7.3.txt) and the one failing with rocm 6.0 (Dockerfile-rocm6.0.txt). Please let me know if you find something wrong in these files.

@tcojean
Copy link
Member

tcojean commented Jan 16, 2024

Thanks a lot for the report and the details! I believe this is normal, we have not yet tested ROCm 6.0 and thankfully, ROCm 6.0 now enforces the FHS standard within its directory. This is generally good news as many things can be simplified, but we have not proofed our CMake build system for that yet.

Alternatively, maybe we can finally adopt the native HIP language support within CMake, and rewrite (simplify) our CMake HIP build system, which should also sidestep the issue.

@tcojean tcojean added is:bug Something looks wrong. mod:hip This is related to the HIP module. reg:build This is related to the build system. labels Jan 16, 2024
@tpadioleau
Copy link
Author

Ok thanks the quick reply!

@upsj
Copy link
Member

upsj commented Feb 21, 2024

I can confirm that #1334 works on ROCm 6.0.2

@upsj upsj self-assigned this Feb 21, 2024
@lahwaacz
Copy link
Contributor

lahwaacz commented Mar 9, 2024

I managed to build ginkgo 1.7.0 with ROCm 6.0 by setting the following env vars. That is, without benchmarks which are affected by #1566

export ROCM_PATH=/opt/rocm
export HIP_PATH="$ROCM_PATH"
export HIP_THRUST_PATH="$HIP_PATH"/include

@upsj
Copy link
Member

upsj commented Apr 12, 2024

Should be fixed by #1334

@upsj upsj closed this as completed Apr 12, 2024
@lahwaacz
Copy link
Contributor

@upsj hip_path.cmake still defaults to /opt/rocm/hip for HIP_PATH which does not work with ROCm 6.0:

set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed")

Furthermore, hip.cmake has a code path where $ENV{HIP_PATH}/.. is used for `ROCM_PATH:

set(ROCM_PATH "$ENV{HIP_PATH}/.." CACHE PATH "Path to which ROCM has been installed")

It would be nice if Ginkgo could auto-detect ROCm version and use the correct paths for 6.0 by default 😉

@lahwaacz
Copy link
Contributor

Actually, do you need any special handling for the paths at all? CMake can auto-detect ROCm/HIP just fine...

@upsj
Copy link
Member

upsj commented Apr 13, 2024

The only reason we need this right now is to enable autodetection of the hipBLAS/... paths, but that should be handled correctly by an environment where they are all part of the CMAKE_PREFIX_PATH. So hopefully we don't need it at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Something looks wrong. mod:hip This is related to the HIP module. reg:build This is related to the build system.
Projects
None yet
Development

No branches or pull requests

4 participants