From 0f77cca304617a91c3b521c6f41ff2342af80d39 Mon Sep 17 00:00:00 2001 From: Stefan-Olt Date: Fri, 19 Sep 2025 19:36:37 +0200 Subject: [PATCH 1/3] HipBLAS / ROCm build instruction fix --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 62b597911..872af42bf 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,14 @@ cmake --build . --config Release ##### Using HipBLAS This provides BLAS acceleration using the ROCm cores of your AMD GPU. Make sure to have the ROCm toolkit installed. +To build for another GPU architecture than installed in your system, set `$GFX_NAME` manually to the desired architecture. This is also necessary if your GPU is not officially supported by ROCm, for example set `$GFX_NAME` to `gfx1030` for consumer RDNA2 cards. Windows User Refer to [docs/hipBLAS_on_Windows.md](docs%2FhipBLAS_on_Windows.md) for a comprehensive guide. ``` export GFX_NAME=$(rocminfo | grep -m 1 -E "gfx[^0]{1}" | sed -e 's/ *Name: *//' | awk '{$1=$1; print}' || echo "rocminfo missing") echo $GFX_NAME -cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=$GFX_NAME -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON +cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=$GFX_NAME -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON cmake --build . --config Release ``` From 51dadf5a0fb58ec8e4471e909bdecb9cb8f1bc72 Mon Sep 17 00:00:00 2001 From: Stefan-Olt Date: Sat, 20 Sep 2025 10:05:39 +0200 Subject: [PATCH 2/3] Update HipBLAS / ROCm build instructions --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 872af42bf..62e206b1e 100644 --- a/README.md +++ b/README.md @@ -125,14 +125,14 @@ cmake --build . --config Release ##### Using HipBLAS This provides BLAS acceleration using the ROCm cores of your AMD GPU. Make sure to have the ROCm toolkit installed. -To build for another GPU architecture than installed in your system, set `$GFX_NAME` manually to the desired architecture. This is also necessary if your GPU is not officially supported by ROCm, for example set `$GFX_NAME` to `gfx1030` for consumer RDNA2 cards. +To build for another GPU architecture than installed in your system, set `$GFX_NAME` manually to the desired architecture (replace first command). This is also necessary if your GPU is not officially supported by ROCm, for example you have to set `$GFX_NAME` manually to `gfx1030` for consumer RDNA2 cards. Windows User Refer to [docs/hipBLAS_on_Windows.md](docs%2FhipBLAS_on_Windows.md) for a comprehensive guide. ``` -export GFX_NAME=$(rocminfo | grep -m 1 -E "gfx[^0]{1}" | sed -e 's/ *Name: *//' | awk '{$1=$1; print}' || echo "rocminfo missing") -echo $GFX_NAME -cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=$GFX_NAME -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON +if command -v rocminfo; then export GFX_NAME=$(rocminfo | grep -m 1 -E "gfx[^0]{1}" | sed -e 's/ *Name: *//' | awk '{$1=$1; print}'); else echo "rocminfo missing!"; fi +if [ -z "${GFX_NAME}" ]; then echo 'Error: Could detect GPU!'; else echo "Building for GPU: ${GFX_NAME}"; fi +cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=$GFX_NAME -DAMDGPU_TARGETS=$GFX_NAME -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON cmake --build . --config Release ``` From bdb365fbd8dab5253b65fda157141a80f4ef5f3a Mon Sep 17 00:00:00 2001 From: Stefan-Olt Date: Sun, 21 Sep 2025 12:05:20 +0200 Subject: [PATCH 3/3] Fix typo and optimize HipBLAS / ROCm build instructions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62e206b1e..c5c3eb1a3 100644 --- a/README.md +++ b/README.md @@ -130,8 +130,8 @@ To build for another GPU architecture than installed in your system, set `$GFX_N Windows User Refer to [docs/hipBLAS_on_Windows.md](docs%2FhipBLAS_on_Windows.md) for a comprehensive guide. ``` -if command -v rocminfo; then export GFX_NAME=$(rocminfo | grep -m 1 -E "gfx[^0]{1}" | sed -e 's/ *Name: *//' | awk '{$1=$1; print}'); else echo "rocminfo missing!"; fi -if [ -z "${GFX_NAME}" ]; then echo 'Error: Could detect GPU!'; else echo "Building for GPU: ${GFX_NAME}"; fi +if command -v rocminfo; then export GFX_NAME=$(rocminfo | awk '/ *Name: +gfx[1-9]/ {print $2; exit}'); else echo "rocminfo missing!"; fi +if [ -z "${GFX_NAME}" ]; then echo "Error: Couldn't detect GPU!"; else echo "Building for GPU: ${GFX_NAME}"; fi cmake .. -G "Ninja" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS=$GFX_NAME -DAMDGPU_TARGETS=$GFX_NAME -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON cmake --build . --config Release ```