Skip to content

Build from source

fszontagh edited this page Mar 23, 2025 · 1 revision

Install dependencies - Ubuntu 24

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-dev

Install dependencies - Ubuntu 22

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-dev

Install dependencies - Windows

On 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.

Prepare Conan profile & build collect dependencies

New-Item -ItemType Directory -Force -Path build
cd build
conan profile detect
conan install .. -s compiler.cppstd=17 --build=missing

For CUDA, VULKAN and HIPBLAS, you need to install the corresponding packages.

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 ..

Build only the GUI

cmake -DCMAKE_BUILD_TYPE=Release -DSDGUI_SERVER=OFF -DSDGUI_CUDA=ON ..

Build only backend libs

cmake .. -DSDGUI_SERVER=OFF -DSDGUI_WINDOWLESS=ON -DSDGUI_VULKAN=ON

Build only backend libs without llama.cpp

cmake .. -DSDGUI_SERVER=OFF -DSDGUI_WINDOWLESS=ON -DSDGUI_VULKAN=ON -DSDGUI_LLAMA_DISABLE=ON

Where 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.

Clone this wiki locally