Hello again! Sorry for late response, have not had access to computer during weekend.
Installation
I tried installing AMD ROCm and configuring the build in LAMMPS with it on my OS Ubuntu 22.04.2 LTS (Jammy Jellyfish). I followed the steps at: AMD Documentation - Portal
1:
sudo apt-get update
wget https://repo.radeon.com/amdgpu-install/5.4.3/ubuntu/jammy/amdgpu-install_5.4.50403-1_all.deb
sudo apt-get install ./amdgpu-install_5.4.50403-1_all.deb
2:
echo 'deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/amdgpu/5.4.3/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/amdgpu.list
3:
echo 'deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/rocm/apt/5.4.3 jammy main' | sudo tee /etc/apt/sources.list.d/rocm.list echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 sudo apt-get update
4:
sudo apt install rocm-hip-sdk
Check post install actions and verifications:
dkms status
output:
amdgpu/6.0.5-1581431.22.04, 5.19.0-41-generic, x86_64: installed
rocminfo
sucessfully identifies my GPU:
…
Name: gfx803
Uuid: GPU-XX
Marketing Name: AMD Radeon ™ RX 480 Graphics
Vendor Name: AMD
Feature: KERNEL_DISPATCH
Profile: BASE_PROFILE
Float Round Mode: NEAR
Max Queue Number: 128(0x80)
Queue Min Size: 64(0x40)
Queue Max Size: 131072(0x20000)
…
LAMMPS build
I proceed to follow the steps given in 3.7. Packages with extra build options — LAMMPS documentation and 3.6. Include packages in build — LAMMPS documentation
export HIP_PLATFORM=amd
export HIP_PATH=/opt/rocm-5.4.3
cmake -C ../cmake/presets/most.cmake -C ../cmake/presets/nolib.cmake -D PKG_GPU=on GPU_API=HIP -D HIP_ARCH=gfx 803 -D CMAKE_CXX_COMPILER=hipcc ../cmake
…
make -j 20
Test build:
in: examples/granular/
mpirun -np 20 lmp -in in.pour.drum
works fine.
lmp -in in.pour.drum
works fine.
lmp -sf gpu -in in.pour.drum
output:
LAMMPS (28 Mar 2023)
ERROR: Invalid OpenCL platform ID. (src/GPU/gpu_extra.h:77)
Last command: package gpu 0
Note
Why does it try to identify an openCL platform when I built with HIP? Also, I had the option to use the following installation for ROcm:
sudo apt install rocm-hip-sdk rocm-opencl-sdk
Was I supposed to use this instead?
I just realized that I didnt include a -D flag between “PKG_GPU=on” and “GPU_API=HIP”. Could it be that it set to building openCL anyways?
I’m really clueless when it comes to all this stuff so I just kinda try my way, google until things “work”. Am I missing something obvious?