<p>
        Hello Vedran,
</p>
<p>
        Thanks for trying the hipified gromacs and I'm sorry for not replying in time. I&nbsp;didn't receive your email until last night, which may&nbsp;be because that I&nbsp;turned on the digest mode of the mailing list. Now I have turned that mode off.
</p>
<p>
        The rocfft package is necessary. Removing the find_package(rocfft REQUIRED) clause will cause errors&nbsp;on the linking stage.
</p>
<p>
        The rocfft package is a part of rocm platform, but not&nbsp;a part of gromacs. Please make sure that you have installed the rocfft package&nbsp;on your computer. It should locate in /opt/rocm by default.
</p>
<p>
        The rocfft package offers rocfft-config.cmake configuration file, which locates in /opt/rocm/rocfft/lib/cmake/rocfft by default.&nbsp;The &nbsp;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&nbsp;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&nbsp;the config.sh file is to do this work.
</p>
<p>
        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:
</p>
<p>
        return lerp((float)d01.x, (float)d01.y, fraction);
</p>
<p>
        Then I can build all the project.
</p>
<p>
        I have updated the code in my github repository. Please try it again!
</p>
<p>
        <br>
</p>
<p>
        Sincerely,
</p>
<p>
        Zhang
</p>
<p>
        <br>
</p>
<p>
        ----------------------------------------------------------------------
</p>
<p>
        Message: 1<br>
Date: Mon, 6 Jan 2020 12:05:48 +0100<br>
From: Vedran Mileti? &lt;vedran@miletic.net&gt;<br>
To: gmx-developers@gromacs.org<br>
Subject: Re: [gmx-developers] A HIP version of gromacs 2018.7<br>
Message-ID: &lt;d2dd5f00-f8d9-4364-c93e-fbca1455af88@miletic.net&gt;<br>
Content-Type: text/plain; charset=utf-8; format=flowed<br>
<br>
Hi Zhang,<br>
<br>
I tried to compile your version on Vega 20 (so it's gfx906 as well) <br>
with ROCm 3.0 using the command:<br>
<br>
cmake -DBUILD_SHARED_LIBS=ON -DGMX_BUILD_FOR_COVERAGE=on <br>
-DCMAKE_BUILD_TYPE=Release -DGMX_CUDA_NB_SINGLE_COMPILATION_UNIT=on <br>
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DGMX_MPI=on <br>
-DGMX_GPU=on -DGMX_OPENMP=on -DGMX_GPU_DETECTION_DONE=on <br>
-DHIP_TOOLKIT_ROOT_DIR=/opt/rocm/hip -DGMX_SIMD=AUTO <br>
-DGMX_FFT_LIBRARY=fftw3 -DREGRESSIONTEST_DOWNLOAD=OFF <br>
-DCMAKE_PREFIX_PATH=/opt/rocm/rocfft/lib/cmake/rocfft/:/opt/rocm/hip/cmake <br>
-DGMX_DEVELOPER_BUILD=off ..<br>
<br>
After removing find_package(rocfft REQUIRED) in <br>
src/gromacs/CMakeLists.txt which fails due to missing Findrocfft.cmake <br>
(perhaps you forgot to add the file?), the configuration succeeds, but <br>
the compilation fails with:<br>
<br>
$ make<br>
[&nbsp; 1%] Built target tng_io_zlib<br>
[&nbsp; 1%] Generating git version information<br>
[&nbsp; 1%] Built target git-version-info<br>
[&nbsp; 2%] Built target tng_io_obj<br>
[&nbsp; 2%] Building HIPCC object <br>
src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/libgromacs_generated_nbnxn_cuda.cu.o<br>
clang-10: warning: argument unused during compilation: <br>
'--amdgpu-target=gfx906' [-Wunused-command-line-argument]<br>
In file included from <br>
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu:1:<br>
In file included from /opt/rocm/include/hip/hip_runtime.h:56:<br>
In file included from /opt/rocm/include/hip/hcc_detail/hip_runtime.h:106:<br>
/opt/rocm/include/hip/hcc_detail/texture_functions.h:173:5: warning: <br>
array designators are a C99 extension [-Wc99-designator]<br>
&nbsp;&nbsp;&nbsp;&nbsp; [HIP_AD_FORMAT_NOT_INITIALIZED] = 1&nbsp; ,<br>
&nbsp;&nbsp;&nbsp;&nbsp; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
1 warning generated.<br>
In file included from <br>
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu:1:<br>
In file included from /opt/rocm/include/hip/hip_runtime.h:56:<br>
In file included from /opt/rocm/include/hip/hcc_detail/hip_runtime.h:106:<br>
/opt/rocm/include/hip/hcc_detail/texture_functions.h:173:5: warning: <br>
array designators are a C99 extension [-Wc99-designator]<br>
&nbsp;&nbsp;&nbsp;&nbsp; [HIP_AD_FORMAT_NOT_INITIALIZED] = 1&nbsp; ,<br>
&nbsp;&nbsp;&nbsp;&nbsp; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
In file included from <br>
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu:118:<br>
In file included from <br>
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cuh:52:<br>
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh:440:12: <br>
error: no matching function for call to 'lerp'<br>
&nbsp;&nbsp;&nbsp;&nbsp; return lerp(d01.x, d01.y, fraction);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^~~~<br>
/home/vedranm/workspace/hipified-gromacs/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh:423:3: <br>
note: candidate template ignored: deduced conflicting types for <br>
parameter 'T' ('Scalar_accessor&lt;[2 * ...], 0&gt;' vs. 'Scalar_accessor&lt;[2 * <br>
...], 1&gt;')<br>
T lerp(T d0, T d1, T t)<br>
&nbsp;&nbsp; ^<br>
1 warning and 1 error generated.<br>
CMake Error at libgromacs_generated_nbnxn_cuda.cu.o.cmake:174 (message):<br>
&nbsp;&nbsp; Error generating file<br>
<br>
/home/vedranm/workspace/hipified-gromacs/builddir/src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/./libgromacs_generated_nbnxn_cuda.cu.o<br>
<br>
<br>
src/gromacs/CMakeFiles/libgromacs.dir/build.make:411: recipe for target <br>
'src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/libgromacs_generated_nbnxn_cuda.cu.o' <br>
failed<br>
make[2]: *** <br>
[src/gromacs/CMakeFiles/libgromacs.dir/mdlib/nbnxn_cuda/libgromacs_generated_nbnxn_cuda.cu.o] <br>
Error 1<br>
CMakeFiles/Makefile2:2886: recipe for target <br>
'src/gromacs/CMakeFiles/libgromacs.dir/all' failed<br>
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2<br>
Makefile:162: recipe for target 'all' failed<br>
make: *** [all] Error 2<br>
<br>
Any ideas?<br>
<br>
Thanks in advance.<br>
<br>
Vedran<br>
</p>
<p>
        <br>
</p>