Conversation
It looks like cudaGraphInstantiateWithParams is more compatible with the signature of hipGraphInstantiateWithParams.
It looks like the HIP code path relies on this to work correctly, but I don't know why.
jhenin
left a comment
There was a problem hiding this comment.
This is sensitive to the toolchain version (of course). With ROCm 6.4.3 I get "use of undeclared identifier '__syncwarp'", but with ROCm 7.1.1 I get into a kind dependency hell on the machine I'm trying (it loads the wrong compiler). Not an issue with the PR itself, but that explains why I couldn't finish the test just yet.
| check_language(CUDA) | ||
| enable_language(CUDA) | ||
| if(NOT EXISTS ${COLVARS_SOURCE_DIR}) | ||
| set(COLVARS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." CACHE STRING "Colvars source code directory") |
There was a problem hiding this comment.
This is not working for me when cmake is run from within tests/functional_gpu/build - it's missing one level to go back to the Colvars root. I realized the same issue exists in namd/cudaglobalmaster/CMakeLists.txt. Unless I am missing something...
There was a problem hiding this comment.
I am not what the best way to detect the Colvars source directory is. Could you specify -DCOLVARS_SOURCE_DIR= explicitly?
There was a problem hiding this comment.
I can do that but I am wondering if this default path is the correct one. Does the default work for you?
There was a problem hiding this comment.
It works for me. If I understand correctly, "CMAKE_CURRENT_SOURCE_DIR" should point to the directory containing the "CMakeLists.txt" being processed.
The code should be OK with ROCm 7.2.0 and 7.2.2. |
I have tried to make the code compatible with ROCm 6.4.2 in the two latest commits. |
This is only a draft PR at present. I haven't figured out how to use libhipcxx forcuda::std::array.Update:
I have implemented
colvars_gpu::array1dto avoid the use of libhipcxx. The unit tests can now be run on HIP. You can build therun_colvars_test_cudaon HIP with the following commands:and then run
makeandmake test. The test passed on my laptop with Radeon 610M and also Frontier with MI250X (requires `-DCMAKE_HIP_ARCHITECTURES="gfx90a").