Suggest setting AMDGPU_TARGETS

Currently, when building llama.cpp with CMake and hipBLAS option, it
will build for gfx900, gfx906, gfx908, gfx90a, gfx1030 if using 5.6.1 or
older. And, build for gfx906 if using ROCm 5.7.0 or 5.7.1.

The former raised multiple issues that CMake build wasn't working for
RDNA3 cards, and once ROCm 5.7.0 or 5.7.1 is available in popular linux
distributions, it will surely raise issues for most AMD cards owner.

This issue was fixed upstream 3 days ago, it will do something similar
to this suggestion.
This commit is contained in:
ardfork 2023-11-09 18:24:33 +00:00
parent a75fa576ab
commit 811c26a1c8

View file

@ -419,8 +419,8 @@ Building the program with BLAS support may lead to some performance improvements
```bash
mkdir build
cd build
CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++ cmake .. -DLLAMA_HIPBLAS=ON
cmake --build .
CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++ cmake .. -DLLAMA_HIPBLAS=ON -DAMDGPU_TARGETS=native
cmake --build . --config Release
```
The environment variable [`HIP_VISIBLE_DEVICES`](https://rocm.docs.amd.com/en/latest/understand/gpu_isolation.html#hip-visible-devices) can be used to specify which GPU(s) will be used.