-
Notifications
You must be signed in to change notification settings - Fork 10
Build from source
fszontagh edited this page Mar 23, 2025
·
1 revision
sudo apt install -y fuse3 cmake gettext git build-essential ninja-build libexiv2-dev libssl-dev libjpeg-dev libpng-dev libtiff-dev libgtk-3-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev libwebkit2gtk-4.1-dev libsdl2-dev libomp-devsudo apt install -y fuse3 cmake gettext git build-essential ninja-build libexiv2-dev libssl-dev libjpeg-dev libpng-dev libtiff-dev libgtk-3-dev libcurl4-openssl-dev libsecret-1-dev libnotify-dev libwebkit2gtk-4.1-dev libsdl2-dev libomp-devOn windows for dependencies you need to install python to install Conan:
python -m pip install --upgrade pip
pip install conan
Or you can download Conan installer from here
To build, you need to install cmake and MSVC.
New-Item -ItemType Directory -Force -Path build
cd build
conan profile detect
conan install .. -s compiler.cppstd=17 --build=missingFor CUDA, VULKAN and HIPBLAS, you need to install the corresponding packages.
- CUDA: https://developer.nvidia.com/cuda-downloads
- VULKAN: https://vulkan.lunarg.com/sdk/home
- HIPBLAS: https://github.com/ROCmSoftwarePlatform/hipBLAS/releases
After collecting dependencies, you can build the project. All cmake options are the same, except for the following on windows:
-
--preset conan-default- use conan preset -
-DCUDA_TOOLKIT_ROOT_DIR=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2- set CUDA path. The path depends on your CUDA version.
For example, to build the project with CUDA only backend without the server component, run the following command:
cmake -DCMAKE_BUILD_TYPE=Release -DSDGUI_SERVER=OFF -DSDGUI_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2 --preset conan-default ..cmake -DCMAKE_BUILD_TYPE=Release -DSDGUI_SERVER=OFF -DSDGUI_CUDA=ON ..cmake .. -DSDGUI_SERVER=OFF -DSDGUI_WINDOWLESS=ON -DSDGUI_VULKAN=ONcmake .. -DSDGUI_SERVER=OFF -DSDGUI_WINDOWLESS=ON -DSDGUI_VULKAN=ON -DSDGUI_LLAMA_DISABLE=ONWhere the flags are:
-
-DSDGUI_SERVER=OFF- disable server -
-DSDGUI_WINDOWLESS=ON- disable window -
-DSDGUI_VULKAN=ON- enable vulkan
Possible lib flags are:
-
-SDGUI_AVX=ON- enable AVX -
-SDGUI_AVX2=ON- enable AVX2 -
-SDGUI_AVX512=ON- enable AVX512 -
-SDGUI_CUDA=ON- enable CUDA -
-SDGUI_VULKAN=ON- enable Vulkan -
-SDGUI_HIPBLAS=ON- enable HIPBLAS
When multiple flags are set, all lib variations are built.