Is it possible to install the LAMMPS GPU package on AMD Radeon?

794 Views Asked by At

I've been searching all the Internet looking for this answer but couldn't find. The thing is, I have a graphics card from AMD (R9 380). From what I was reading on the LAMMPS manual, the GPU package would only work with NVIDIA cards, since AMD's doesn't have cuda cores. But they also have a Makefile.linux_opencl, which, in theory, would work with AMD cards. I'm trying to install this GPU package for 2 days with no success... Has someone succeeded to install this package with an AMD card? If so, what is the catch?

3

There are 3 best solutions below

0
On

Did you ever get this to work? This works on my system:

git clone https://github.com/lammps/lammps -b stable
cd lammps/lib/gpu
make -f Makefile.linux_opencl
cd ../../src
make yes-gpu
make mpi

The CMake build system works here too.

2
On

Quick look says it supports both AMD & NVidia (OpenCL & CUDA), so the answer is likely "yes". Did you try to clone from their github repo and build it with CMake ?

cmake /path/to/lammps/source/cmake -DENABLE_GPU=ON

i'm wildly guessing whatever makefiles they have are outdated...

0
On

I had the same problem, running R9 280x from some mining equipment. I had succeeded with this configuration:

My prereqs:

  • Motherboard: Gigabyte P55A-UD4
  • CPU: intel core i5 760
  • GPU: R9 280x

Drivers

  1. Set the hardware switch on the gpu to position 1 (default position) Download and install Ubuntu 14.06.3 (make sure that the kernel is Linux 3.19)

  2. Check if the correct kernel is installed with uname -r

  3. Run: apt-get update and upgrade

  4. Run: sudo apt-get install git make cmake gcc g++ gzip libfftw3-dev libtbb-dev mklibs mpich mpi-default-dev openmpi-bin ocl-icd-opencl-dev lib32gcc1 libc6-i386 dkms

  5. From the AMD’s official site (for 280x: https://www.amd.com/en/support/graphics/amd-radeon-r9-series/amd-radeon-r9-200-series/amd-radeon-r9-280x) download all 4 drivers (fglrx, fglrx-core, fglrx-dev and fglrx-amdcccle) version 15.302 for Ubuntu 14.04. Use the installer notes file to install them properly (in the order specified below (or in the notes file)!)

  6. Run: sudo dpkg -i fglrx-core_15.302-0ubuntu1_amd64_ub_14.01.deb fglrx_15.302-0ubuntu1_amd64_ub_14.01.deb fglrx-dev_15.302-0ubuntu1_amd64_ub_14.01.deb fglrx-amdcccle_15.302-0ubuntu1_amd64_ub_14.01.deb

  7. Check if all drivers are installed properly with: dpkg -l fglrx-core fglrx fglrx-dev fglrx-amdcccle

  8. Reboot machine

  9. Run: clinfo and check if any errors exist (I had problems with fglrx)

LAMMPS

  1. From home directory run: git clone http://github.com/lammps/lammps.git or extract any older version of lammps (from Github or other sites). Currently the version is 19 sep 2019

  2. In the folder ~/lammps/lib/gpu check if Makefile.linux_opencl is ok with your sistem (for 280x i had used the default settings)

  3. Compile the file using “make -f Makefile.linux_opencl” from the lib/gpu folder

  4. Go to LAMMPS's src directory and run from there : make yes-gpu, make yes-user-omp

  5. In the folder src/MAKE enable the cxx98 C++ compiler by deleting the comment (# mark) in the file make_mpi, line: LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 # -DLAMMPS_CXX98

  6. from folder src/ run: make mpi

  7. Your LAMMPS program should be compiled, the main file is located in the folder lammps/src/lmp_mpi.

  8. When running the program you should run it via this directory or add this directory to PATH (export PATH="$PATH:/lammps/src")

Further work

Although when I wanted to install on newer hardware (ASUS prime b250m-k and intel pentium g4600) I had problems with graphical drivers, but I hadn't resolved the problem.