[gmx-developers] A HIP version of gromacs 2018.7

张驭洲 zhangyuzhou15 at mails.ucas.edu.cn
Wed Jan 8 07:09:32 CET 2020

Hello Vedran,

Thanks for trying the hipified gromacs and I'm sorry for not replying in time. I didn't receive your email until last night, which may be because that I turned on the digest mode of the mailing list. Now I have turned that mode off.

The rocfft package is necessary. Removing the find_package(rocfft REQUIRED) clause will cause errors on the linking stage.

The rocfft package is a part of rocm platform, but not a part of gromacs. Please make sure that you have installed the rocfft package on your computer. It should locate in /opt/rocm by default.

The rocfft package offers rocfft-config.cmake configuration file, which locates in /opt/rocm/rocfft/lib/cmake/rocfft by default. The  find_package(rocfft REQUIRED) clause makes cmake to find Findrocfft.cmake first, and it should try to find rocfft-config.cmake after failing to find Findrocfft.cmake. If you have rocfft package installed but cmake can still not find the rocfft cmake configuration file, maybe you can try to set the exact location of the file by adding more parameters to find_package clause. By the way, I think the DCMAKE_PREFIX_PATH parameter in the config.sh file is to do this work.

I managed to get a rocm 3.0 environment to test the code, and I also encountered the error about the lerp function as you did. It may be because rocm has changed something so that it does not recognize every component of a float2 as normal float. I added two type casts to the call to 'lerp', and now it looks like this:

return lerp((float)d01.x, (float)d01.y, fraction);

Then I can build all the project.

I have updated the code in my github repository. Please try it again!




Message: 1
Date: Mon, 6 Jan 2020 12:05:48 +0100
From: Vedran Mileti? <vedran at miletic.net>
To: gmx-developers at gromacs.org
Subject: Re: [gmx-developers] A HIP version of gromacs 2018.7
Message-ID: <d2dd5f00-f8d9-4364-c93e-fbca1455af88 at miletic.net>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi Zhang,

I tried to compile your version on Vega 20 (so it's gfx906 as well)
with ROCm 3.0 using the command:


After removing find_package(rocfft REQUIRED) in
src/gromacs/CMakeLists.txt which fails due to missing Findrocfft.cmake
(perhaps you forgot to add the file?), the configuration succeeds, but
the compilation fails with:

$ make
[  1%] Built target tng_io_zlib
[  1%] Generating git version information
[  1%] Built target git-version-info
[  2%] Built target tng_io_obj
[  2%] Building HIPCC object
clang-10: warning: argument unused during compilation:
'--amdgpu-target=gfx906' [-Wunused-command-line-argument]
In file included from
In file included from /opt/rocm/include/hip/hip_runtime.h:56:
In file included from /opt/rocm/include/hip/hcc_detail/hip_runtime.h:106:
/opt/rocm/include/hip/hcc_detail/texture_functions.h:173:5: warning:
array designators are a C99 extension [-Wc99-designator]
1 warning generated.
In file included from
In file included from /opt/rocm/include/hip/hip_runtime.h:56:
In file included from /opt/rocm/include/hip/hcc_detail/hip_runtime.h:106:
/opt/rocm/include/hip/hcc_detail/texture_functions.h:173:5: warning:
array designators are a C99 extension [-Wc99-designator]
In file included from
In file included from
error: no matching function for call to 'lerp'
     return lerp(d01.x, d01.y, fraction);
note: candidate template ignored: deduced conflicting types for
parameter 'T' ('Scalar_accessor<[2 * ...], 0>' vs. 'Scalar_accessor<[2 *
...], 1>')
T lerp(T d0, T d1, T t)
1 warning and 1 error generated.
CMake Error at libgromacs_generated_nbnxn_cuda.cu.o.cmake:174 (message):
   Error generating file


src/gromacs/CMakeFiles/libgromacs.dir/build.make:411: recipe for target
make[2]: ***
Error 1
CMakeFiles/Makefile2:2886: recipe for target
'src/gromacs/CMakeFiles/libgromacs.dir/all' failed
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

Any ideas?

Thanks in advance.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20200108/48631ecc/attachment.html>

More information about the gromacs.org_gmx-developers mailing list