Skip to content

Instantly share code, notes, and snippets.

@cgmb
Last active December 19, 2024 20:38
Show Gist options
  • Save cgmb/fb25dd4cd0130ad1eb4a5ea224189532 to your computer and use it in GitHub Desktop.
Save cgmb/fb25dd4cd0130ad1eb4a5ea224189532 to your computer and use it in GitHub Desktop.
Build magma for HIP
#!/bin/bash
# Build Magma on Ubuntu 24.04
set -eux
export CXX=hipcc
apt-get -y update
apt-get -y upgrade
apt-get -y install git cmake build-essential libopenblas-dev gfortran hipcc librocblas-dev libhipblas-dev librocsparse-dev libhipsparse-dev
git clone https://github.com/icl-utk-edu/magma.git
cd magma
git checkout v2.8.0
echo -e 'BACKEND = hip\nFORT = true\nGPU_TARGET = gfx803 gfx900 gfx906 gfx908 gfx90a gfx1010 gfx1030 gfx1100 gfx1101 gfx1102' > make.inc
sed -i '1s/python$/python3/' tools/codegen.py
sed -i 's/hip::host/hip::device/' CMakeLists.txt
make generate
cmake -S. -Bbuild -DBLA_VENDOR=OpenBLAS -DAMDGPU_TARGETS="gfx803;gfx900;gfx906;gfx908;gfx90a;gfx1010;gfx1030;gfx1100;gfx1101;gfx1102" -DMAGMA_ENABLE_HIP=ON
make -j8 -C build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment