-
-
Notifications
You must be signed in to change notification settings - Fork 408
ROCm HIP SDK Windows Support
This is a guide to build rocBLAS based on the ROCm Official Documentations.
You may have an AMD GPU without official support on ROCm HIP SDK OR if you are using integrated AMD GPU (iGPU), and want it to be supported by HIP SDK on Windows. You may follow the guide below to build your rocBLAS.
Make sure you have the following software available on your PC. Otherwise, you may fail to build the ROCmLibs:
- Visual Studio 2022
- Python
- Strawberry Perl
- CMake
- Git
- HIP SDK (Mentioned in the first step)
- Download rocBLAS and Tensile (Download Tensile 4.38.0 for ROCm 5.7.0 (latest) on Windows)
Edit line 41 in file rdeps.py for rocBLAS. The old repo has an outdated vckpg, which will lead to failed build. Update the vcpkg by entering the following line in the terminal:
git clone -b 2024.02.14 https:/microsoft/vcpkg
Download Tensile 4.38.0
from the release page.
Download Tensile-fix-fallback-arch-build.patch, and place in the Tensile
folder. In this example, the path is: C:\ROCm\Tensile-rocm-5.7.0
.
Enter the following line in the terminal opened in Tensile-rocm-5.7.0
:
git apply Tensile-fix-fallback-arch-build.patch
if your vckpkg version is built later than April, 2023, please replace the CMakeLists.txt
in Tensile/tree/develop/Tensile/Source/lib/CMakeLists.txt
with this CMakeLists.txt, and put in same folder. (For more information, please access ROCm Official Guide)
In C:\ROCm\rocBLAS-rocm-5.7.0
, run:
python rdeps.py
If you encounter any mistake, try to Google and fix it or try it again. Use install.sh -d
in Linux.
Once done, run:
python rmake.py -a "gfx906;gfx1012" --lazy-library-loading --no-merge-architectures -t "C:\ROCm\Tensile-rocm-5.7.0"
Change gfx906;gfx1012
to your GPU LLVM Target. If you want to build multiple ones at a time, make sure to separate with ;
.
Upon successful compilation, rocblas.dll will be generated. In this example, 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 need to replace the rocblas.dll file in the SDK with the one that you have just made yourself. Then, place rocblas.dll
into C:\Program Files\AMD\ROCm\5.7\bin
and the Tensile data files into C:\Program Files\AMD\ROCm\5.7\bin\rocblas\library
.
Your programs should run smooth as silk on the designated graphics card now.