Porting DualSPHysics to ROCM/HIP to run on AMD Radeon

edited February 2018 in DualSPHysics v4.2
Hello everyone!

I started some tinkering to get DualSPHysics running on AMD Radeon on Linux with https://github.com/RadeonOpenCompute/ROCm

There are some reasons to get ROCm support:
- AMD Radeon has a very high FLOPS-to-price ratio. Mine RX 580 has about 6TFLOPS fp32 computation power.
- Heterogeneous computing, CPU+GPU can work together (my Ryzen 1700 has about 400 GFLOPS fp32), unified memory (?)
- Single codebase can be used for AMD and Nvidia/Cuda

An issue I've created for it: https://github.com/DualSPHysics/DualSPHysics/issues/3 and repository: https://github.com/kwahoo2/DualSPHysics

Building stops on linking stage for now. Hipified objects cannot be linked to static library LibsLinux/v4.2.030_gcc4/libjwavegengpu_64.a since it contains some references to CUDA. If I had source code for these libraries I could hipify them too maybe? Is there a way to obtain the source code of libraries from the LibsLinux directory?

Also, are there programmers who could help/are interested in getting DualSPHysics running on AMD Radeon? My programming skills are very limited.

There are steps to get DualSPHysics on ROCm ecosystem on Linux what I've done so far:
1. Install packages rocm-dkms and rocm-dev as described here https://github.com/RadeonOpenCompute/ROCm
2. Install thrust and cub ports:
git clone https://github.com/ROCmSoftwarePlatform/Thrust
cd Thrust/
sudo cp -r thrust/ /opt/rocm/hip/include/
git clone https://github.com/ROCmSoftwarePlatform/cub-hip
git checkout hip_port_1.7.4
sudo cp -r cub-hip/ /opt/rocm/hip/include/thrust/system/cuda/detail/
3. Install gcc-4.8 and clone https://github.com/kwahoo2/DualSPHysics repository
Sign In or Register to comment.