test / wiki /Rocm-Support.md
bilegentile's picture
Upload folder using huggingface_hub
c19ca42 verified

A newer version of the Gradio SDK is available: 5.21.0

Upgrade

This is a guide to build RocBLAS based on the Rocm Official Resource.

You may have an amd GPU without official support on Rocm HIP SDK 5.7 OR if you are using intergrated GPU (igpu or APU) . and want it supported by HIP SDK on Windows. You may follow the guide below to build your rocBLAS

Extra: if you do not need build roclabs or already have library ,please skip this .

Make sure you have the follow software availbe on your PC ,otherwise ,you may fail to build the roclabs.

  1. Visual Studio 2022
  2. Python
  3. Strawberry Perl
  4. CMake
  5. Git
  6. HIP SDK ( mentioned in first step)
  7. Download rocblas and Tensile ๏ผˆ download Tensile 4.38.0 for ROCm 5.7.0 ( latest) on windows)๏ผŒ replace CMakeLists.txt if you download the tensile 4.38.0from release page please replace cmakeLists in Tensile/tree/develop/Tensile/Source/lib/CMakeLists.txt with this CMakeLists.txt , put in same fold , eg , rocm( more information from rocm official guide )

Download Tensile-fix-fallback-arch-build.patch place in Tensile folder .for example C:\ROCM\Tensile-rocm-5.7.0 open the terminal in Tensile-rocm-5.7.0

git apply Tensile-fix-fallback-arch-build.patch

in the rocm/rocBLAS , run

 python rdeps.py

( if you encounter any mistakes , try to google and fix with it or try it again. using install.sh -d in linux ) after done . try next step

python rmake.py -a "gfx1101;gfx1103" --lazy-library-loading --no-merge-architectures -t "C:\rocm\Tensile-rocm-5.7.0

thegfx1101,gfx1103change to yourgpu or apu namberYou may want to build more gpu support,make sure by seperate with " ; ".

Upon successful compilation, rocblas.dll will be generated in the build\release\staging folder. On my PC, the file path is C:\ROCM\rocBLAS-rocm-5.7.0\build\release\staging\rocblas.dll

In addition, some Tensile data files will also be produced in: C:\ROCM\rocBLAS-rocm-5.7.0\build\release\Tensile\library

To compile HIP SDK programs that use hipBLAS/rocBLAS, you gotta replace the rocblas.dll file in the SDK with the one you just made yourself, Then, Place rocblas.dll into C:\Program Files\AMD\ROCm\5.7\bin and the Tensile data files in the rocblas\library folder, relative to the rocblas.dll file (which is at C:\Program Files\AMD\ROCm\5.7\bin\rocblas\library, innit?). Once that's done, your program should run smooth as silk on the designated graphics card"

Note: you need to change coresponding data inTensile/Common.py in tensile library .change data in " globalParameters["SupportedISA"]" and "CACHED_ASM_CAPS" add data of yourgpu number .and choose the simliar gpu achetecture. eg RND3, then copy and put below with your gpu number and others availble gpu data . if you want more perfect , you may try to use the data availbe inrocBLAS\library\src\blas3\Tensile\Logic\asm_full, change the data in their , eg, navi32,31 , you may build a new fold there namenavi 3x, copy the files in navi32to navi 3x, then open the vs code or visual studio or any other code editor to replace the gpu number .save it . and use navi 3x in your Tensile/Common.pyin terms of "CACHED_ASM_CAPS" .

Note2 : on Linux (6.1.0 roclabs) ,you may need to edit more . search Processor and gfx1102(choose the supported card) in entire tensile folder,add your gpu number in wheregfx1102 shows.Then build again . More information avaialbe on rocm linux .However ,it is not recommended . There easier approach is using HSA_OVERRIDE_GFX_VERSION eg, export HSA_OVERRIDE_GFX_VERSION=11.0.0 overide with support gpu.

All done . Have a good lucy and Hope you enjoy it!