@@ -101,10 +101,64 @@ mountType: virtiofs
101101
102102Once inside the VM, install GPU/Vulkan support:
103103
104+ <details><summary>Click to expand script</summary>
105+
104106` ` ` bash
105- sudo install-vulkan-gpu.sh
107+ # !/bin/bash
108+ # SPDX-FileCopyrightText: Copyright The Lima Authors
109+ # SPDX-License-Identifier: Apache-2.0
110+
111+ set -eu -o pipefail
112+
113+ # Install required packages
114+ dnf install -y dnf-plugins-core dnf-plugin-versionlock llvm18-libs
115+
116+ # Install Vulkan and Mesa base packages
117+ dnf install -y \
118+ mesa-vulkan-drivers \
119+ vulkan-loader-devel \
120+ vulkan-headers \
121+ vulkan-tools \
122+ vulkan-loader \
123+ glslc
124+
125+ # Enable COPR repo with patched Mesa for Venus support
126+ dnf copr enable -y slp/mesa-krunkit fedora-40-aarch64
127+
128+ # Downgrade to patched Mesa version from COPR
129+ dnf downgrade -y mesa-vulkan-drivers.aarch64 \
130+ --repo=copr:copr.fedorainfracloud.org:slp:mesa-krunkit
131+
132+ # Lock Mesa version to prevent automatic upgrades
133+ dnf versionlock add mesa-vulkan-drivers
134+
135+ # Clean up
136+ dnf clean all
137+
138+ echo "Installing llama.cpp with Vulkan support..."
139+ # Build and install llama.cpp with Vulkan support
140+ dnf install -y git cmake clang curl-devel glslc vulkan-devel virglrenderer
141+ (
142+ cd ~
143+ git clone https://github.com/ggml-org/llama.cpp
144+ (
145+ cd llama.cpp
146+ git reset --hard 97340b4c9924be86704dbf155e97c8319849ee19
147+ cmake -B build -DGGML_VULKAN=ON -DGGML_CCACHE=OFF -DCMAKE_INSTALL_PREFIX=/usr
148+ # FIXME: the build seems to fail on Apple M4 Max (and probably on other processors too).
149+ # Error:
150+ # cc1: sorry, unimplemented: no support for ‘sme’ without ‘sve2’
151+ cmake --build build --config Release -j8
152+ cmake --install build
153+ )
154+ rm -fr llama.cpp
155+ )
156+
157+ echo "Successfully installed llama.cpp with Vulkan support. Use 'llama-cli' app with .gguf models."
106158```
107159
160+ </details >
161+
108162The script will prompt to build and install ` llama.cpp ` with Venus support from source.
109163
110164After installation, run:
0 commit comments