Compiling hoomd for rocm 6.3 #1998
MartinGirard
started this conversation in
General
Replies: 2 comments 6 replies
-
Thanks for figuring this out and providing a nice summary! Those changes are reasonable. Are they available on a branch that I could clone? I would like to test them with rocm 6.3 on Frontier. If your branch works on Frontier, then we can drop support for rocm5 and merge the changes. If not, we can make the changes conditional on the rocm version. |
Beta Was this translation helpful? Give feedback.
6 replies
-
@mphoward Yes, 12.x. I think the x >0, but I don't remember exactly. The CI system builds and tests with 12.4. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My institution just got access to a MI300 cluster; I managed to compile hoomd with rocm 6.3 and performance is good. However, this is quite hacky, and I thought I'd leave problems / solutions with the code base here so we can get this fixed later. This is done with the latest trunk-minor branch, commit 23ebdda.
HIP_PLATFORM
To compile on rocm, hoomd sets the
HIP_PLATFORM
to"hip-clang"
. This causes issues with the rocm cmake files, which expects this variable to be set to"amd"
. This requires changing all occurrences of"hip-clang"
to"amd"
.Files:
I have also modified /hoomd/extern/HIP/bin/hipconfig on L99, but it is very unclear whether that was necessary.
This leads to the C++/cuda macro
__HIP_PLATFORM_HCC
to not be defined. Technically, we could rename all macros to__HIP_PLATFORM_AMD__
but this is tedious. Instead, this can be added directly as definitions manually. I have added to HOOMDCUDASetup.cmake on L58:set(CMAKE_HIP_FLAGS "{$CMAKE_HIP_FLAGS} -Wno-unused-result -D__HIP_PLATFORM_HCC__")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__HIP_PLATFORM_HCC__")
For reasons detailed in ROCm/hipFFT#90 , hipfft files are not properly added to includes. I had to manually include them to fix this; in FindCUDALibs.cmake L108-111:
The cuda vector types, eg
float3
, have equivalents in hip throughhip_vector_type
. Multiplication & division operations are now defined on this, which clashes with additions in HOOMDMath.h; the functionsinline hoomd::Scalar3 operator*
andinline hoomd::Scalar3 operator/
need to be placed withinline hoomd::Scalar3 operator+=
, under the macro#if !defined(ENABLE_HIP) || defined(__HIP_PLATFORM_NVCC__)
Beta Was this translation helpful? Give feedback.
All reactions