You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have two options to use Visual Studio to build llama.cpp:
552
+
- As CMake Project using CMake presets.
553
+
- Creating a Visual Studio solution to handle the project.
554
+
555
+
**Note**:
556
+
557
+
All following commands are executed in PowerShell.
558
+
559
+
##### - Open as a CMake Project
560
+
561
+
You can use Visual Studio to open the `llama.cpp` folder directly as a CMake project. Before compiling, select one of the SYCL CMake presets:
544
562
545
-
You can use Visual Studio to open llama.cpp folder as a CMake project. Choose the sycl CMake presets (`x64-windows-sycl-release` or `x64-windows-sycl-debug`) before you compile the project.
563
+
-`x64-windows-sycl-release`
564
+
565
+
-`x64-windows-sycl-debug`
546
566
547
567
*Notes:*
568
+
- For a minimal experimental setup, you can build only the inference executable using:
You can use Visual Studio solution to build and work on llama.cpp on Windows. You need to convert the CMake Project into a `.sln` file.
577
+
578
+
If you want to use the Intel C++ Compiler for the entire `llama.cpp` project, run the following command:
579
+
580
+
```Powershell
581
+
cmake -B build -G "Visual Studio 17 2022" -T "Intel C++ Compiler 2025" -A x64 -DGGML_SYCL=ON -DCMAKE_BUILD_TYPE=Release
582
+
```
583
+
584
+
If you prefer to use the Intel C++ Compiler only for `ggml-sycl`, ensure that `ggml` and its backend libraries are built as shared libraries ( i.e. `-DBUILD_SHARED_LIBRARIES=ON`, this is default behaviour):
585
+
586
+
```Powershell
587
+
cmake -B build -G "Visual Studio 17 2022" -A x64 -DGGML_SYCL=ON -DCMAKE_BUILD_TYPE=Release \
Now, you can build `llama.cpp` with the SYCL backend as a Visual Studio project.
615
+
To do it from menu: `Build -> Build Solution`.
616
+
Once it is completed, final results will be in **build/Release/bin**
617
+
618
+
*Additional Note*
619
+
620
+
- You can avoid specifying `SYCL_INCLUDE_DIR` and `SYCL_LIBRARY_DIR` in the CMake command by setting the environment variables:
621
+
622
+
-`SYCL_INCLUDE_DIR_HINT`
623
+
624
+
-`SYCL_LIBRARY_DIR_HINT`
548
625
549
-
-In case of a minimal experimental setup, the user can build the inference executable only through `cmake --build build --config Release -j --target llama-cli`.
626
+
-Above instruction has been tested with Visual Studio 17 Community edition and oneAPI 2025.0. We expect them to work also with future version if the instructions are adapted accordingly.
0 commit comments