Skip to content

Commit 52315a4

Browse files
authored
readme : update clblast instructions (#2903)
* Update Windows CLBlast instructions * Update Windows CLBlast instructions * Remove trailing whitespace
1 parent 8b56b4f commit 52315a4

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ Building the program with BLAS support may lead to some performance improvements
464464
You will need the [OpenCL SDK](https://github.com/KhronosGroup/OpenCL-SDK).
465465
- For Ubuntu or Debian, the packages `opencl-headers`, `ocl-icd` may be needed.
466466
467+
- For Windows, a pre-built SDK is available on the [OpenCL Releases](https://github.com/KhronosGroup/OpenCL-SDK/releases) page.
468+
467469
- <details>
468470
<summary>Installing the OpenCL SDK from source</summary>
469471
@@ -481,10 +483,27 @@ Building the program with BLAS support may lead to some performance improvements
481483
```
482484
</details>
483485
484-
Installing CLBlast: it may be found in your operating system's packages.
486+
##### Installing CLBlast
487+
488+
Pre-built CLBlast binaries may be found on the [CLBlast Releases](https://github.com/CNugteren/CLBlast/releases) page. For Unix variants, it may also be found in your operating system's packages.
489+
490+
Alternatively, they may be built from source.
485491

486492
- <details>
487-
<summary>If not, then installing from source:</summary>
493+
<summary>Windows:</summary>
494+
495+
```cmd
496+
set OPENCL_SDK_ROOT="C:/OpenCL-SDK-v2023.04.17-Win-x64"
497+
git clone https://github.com/CNugteren/CLBlast.git
498+
mkdir CLBlast\build
499+
cd CLBlast\build
500+
cmake .. -DBUILD_SHARED_LIBS=OFF -DOVERRIDE_MSVC_FLAGS_TO_MT=OFF -DTUNERS=OFF -DOPENCL_ROOT=%OPENCL_SDK_ROOT% -G "Visual Studio 17 2022" -A x64
501+
cmake --build . --config Release
502+
cmake --install . --prefix C:/CLBlast
503+
```
504+
505+
- <details>
506+
<summary>Unix:</summary>
488507

489508
```sh
490509
git clone https://github.com/CNugteren/CLBlast.git
@@ -498,21 +517,32 @@ Building the program with BLAS support may lead to some performance improvements
498517
Where `/some/path` is where the built library will be installed (default is `/usr/local`).
499518
</details>
500519

501-
Building:
520+
##### Building Llama with CLBlast
502521

503522
- Build with make:
504523
```sh
505524
make LLAMA_CLBLAST=1
506525
```
507-
- CMake:
526+
- CMake (Unix):
508527
```sh
509528
mkdir build
510529
cd build
511530
cmake .. -DLLAMA_CLBLAST=ON -DCLBlast_dir=/some/path
512531
cmake --build . --config Release
513532
```
533+
- CMake (Windows):
534+
```cmd
535+
set CL_BLAST_CMAKE_PKG="C:/CLBlast/lib/cmake/CLBlast"
536+
git clone https://github.com/ggerganov/llama.cpp
537+
cd llama.cpp
538+
mkdir build
539+
cd build
540+
cmake .. -DBUILD_SHARED_LIBS=OFF -DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH=%CL_BLAST_CMAKE_PKG% -G "Visual Studio 17 2022" -A x64
541+
cmake --build . --config Release
542+
cmake --install . --prefix C:/LlamaCPP
543+
```
514544

515-
Running:
545+
##### Running Llama with CLBlast
516546

517547
The CLBlast build supports `--gpu-layers|-ngl` like the CUDA version does.
518548

0 commit comments

Comments
 (0)