Repository navigation
Ship the Visual C++ runtime on Windows and require libgomp on Linux - #374
Merged
Merged
Conversation
Upstream llama-server links libgomp.so.1 on Linux and the Visual C++ runtime on Windows. Minimal Linux installs and fresh Windows have neither, so every built-in model failed to start. - deb, rpm and Arch packages (and the AUR PKGBUILD) depend on libgomp. - The Windows archive and installer carry msvcp140, vcruntime140 and vcruntime140_1 from the build machine's Visual Studio redist folder in vc-runtime/. The runtime copies them beside each llama-server.exe (app-local deployment) and refreshes them after an update; the updater adds the folder to older installations. - Setup checks that llama-server loads before recording a runtime, and a failed start names what to install: the library the Linux loader reports, or the Visual C++ Redistributable for 0xC0000135.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lokalbot | bda0400 | Commit Preview URL Branch Preview URL |
Oct 26 2026, 05:03 AM |
stevyhacker
marked this pull request as ready for review
October 26, 2026 06:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream
llama-server(b11669, every backend, CPU included) needs two system libraries that clean or minimal installs lack. Without them every built-in model fails to start:libgomp.so.1, the GCC OpenMP runtime, linked bylibggml-base.soand thelibggml-cpu-*.sovariants. Minimal Debian and Ubuntu installs don't have it, and none of our packages declared it.msvcp140.dll,vcruntime140.dll,vcruntime140_1.dll). A fresh Windows lacks it, andllama-server.exethen exits with 0xC0000135 without printing anything, so LokalBot only said "llama-server exited during startup". LokalBot's own exe links the C runtime statically and doesn't need it.Found while testing PR 354 on vast.ai containers and a Google Cloud Windows Server 2022 VM.
What changes
Linux packages declare libgomp. deb
libgomp1, rpmlibgomp.so.1()(64bit), Archlibgomp(incoresince Arch splitgcc-libs; it ships/usr/lib/libgomp.so.1). The AURPKGBUILDand.SRCINFOget the same dependency, so the two dependency lists stay identical. The release workflow's install check now also fails iflibgomp.so.1is missing. The README lists it for.tar.gzinstalls.The Windows archive and installer carry the Visual C++ runtime.
package.shcopies the three DLLs, unmodified, from the build machine's newest Visual Studio (found withvswhere, using its default redistributable version) intovc-runtime\.VC_REDIST_DIRoverrides the source folder.llama-server.exebefore starting it. A copy that differs from the bundled one is replaced (one a running server holds is replaced at a later start).vc-runtime\to installations that predate it.Missing libraries are named.
llama-server --versiononce before recording a runtime. A runtime that can't load is never installed, so setup no longer reports success with an empty version and no probed flags (what master does).Why app-local DLLs, and not
vc_redist.x64.exefrom the installerPrivilegesRequired=lowest), and LokalBot updates itself in place.vc_redist.x64.exe /installneeds elevation, which would add a UAC prompt to a silent install, and the portable zip and in-place updates would never run it.llama-server.exewhen they differ, as Microsoft asks of local deployment.llama-servereither.lokalbot.exe, so they never replace the system copy for DLLs loaded into LokalBot's own process, such as GPU drivers.vc_redist.x64.exeis about 25 MB.License check
[VisualStudioFolder]\VC\redistwith your program, unmodified. Only thedebug_nonredistfolders are excluded.Microsoft.VC14x.CRTis among the allowed files.THIRD_PARTY_NOTICES.mdgets a section that says:LICENSE.txt.Reproduction (before → after)
Linux:
ubuntu:24.04containerA scratch program, not part of this PR, drives
RuntimeManagerthe way the app does:ensure_runtimewith default settings into a fresh library.stories260K.gguf(ggml-org's 1 MB test model) as its model.Before: the v0.11.3
.deband master's runtime code:Setup "succeeds" with an empty version. Under
autoit also downloaded the Vulkan build, failed to probe it and settled on CPU for good.After, no libgomp1 (a
.tar.gzinstall): this branch's runtime code:After, with this branch's
.deb: built bypackage-linux-distros.shfrom the v0.11.3 release binaries, with this branch's runtime code:Other Linux checks:
libgomp.so.1added, it passes for the new.deb(ubuntu:24.04),.rpm(fedora:41) and Arch package (archlinux:latest);.debwithmissing libgomp.so.1.scripts/ci/check-aur-package.shpasses. namcap's one new warning, "Dependency included, but may not be needed ('libgomp')", is expected and now listed in the AUR README: the app doesn't link libgomp, the runtime it downloads does.libllama-common.soalso links OpenSSL 3 (libssl.so.3,libcrypto.so.3). I left it out of the dependencies because every minimal image I checked already has it:ubuntu:24.04,debian:trixie-slim,fedora:41andarchlinux:latest. Fedora's and Arch's base images also already have libgomp, so only Debian and Ubuntu actually lacked something.Windows
Clean Windows without the Visual C++ Redistributable: a fresh Google Cloud
windows-2022VM (no GPU), with debug builds of the same scratch program. They link the C runtime statically, so they run there.This PR's CI installer on the same VM.
LokalBot-0.11.3-windows-x86_64-setup.execomes from the "Windows archive" job onwindows-2025. I ran the scratch program from the installed folder, so it used the packagedvc-runtime\:Refreshing after an update. Running the installed copy against the earlier library replaced the 14.44 DLLs beside its
llama-server.exewith the installer's 14.51 ones, and left no.newfiles behind:The VM ran for about 20 minutes and has been deleted, along with its disk.
Windows 11 PC with VC++ 14.51 in System32: this branch's runtime code, with
vc-runtime\taken from Build Tools 2022 (redist 14.44):Other Windows checks:
libomp.dllthemselves, and Vulkan addsvulkan-1.dll.package.sh's Visual Studio lookup, run in Git Bash on the PC, findsBuildTools\VC\Redist\MSVC\14.44.35112\x64\Microsoft.VC143.CRT.Tests
New tests:
llama-serverfails like the real one;vc-runtime\to an older installation and refreshing it in a current one.Ubuntu 24.04:
cargo fmt --check,cargo clippy --workspace --all-targets --locked -- -D warnings, andcargo test --workspace --lockedall pass.Windows 11:
cargo test -p lokalbot-ai -p lokalbot-updatepasses (294 and 44 tests).cargo clippy --workspace --all-targetsreports only two "variable does not need to be mutable" warnings inplans/claude.rs. They come from master, are Windows-only, and Windows CI doesn't run clippy.CI: this PR's
linux-windows-release.ymlrun passes.vc-runtime\from the runner's Visual Studio, andcheck-windows-installer.ps1passed, including the newvc-runtimechecks.libgomp.so.1added.Upgrades from older versions
vc-runtime\; the next one does.