Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 0.12.9

- Preserve the NextPlaid log offset in resident-service health views so stale
CUDA diagnostics cannot trigger CPU fallback after service startup.

## 0.12.8

- Fix CUDA provider diagnostics so stale errors from a previous NextPlaid
process cannot force a healthy CUDA runtime onto CPU fallback.

## 0.12.7

- Fix explicit CUDA installer selection and require the CUDA math libraries
used by the ONNX Runtime provider.
- Add version-aware CUDA library path detection and prevent stale provider log
diagnostics from forcing a false CPU fallback.


## 0.12.6

- feat: harden dependencies and release workflows
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ updates your `PATH`.

On Linux x86-64, the installer performs a GPU/driver/CUDA preflight. When a
compatible visible NVIDIA GPU is present, it offers to install whichever CUDA
12 runtime (`cuda-cudart-12-9`) and cuDNN 9 (`cudnn9-cuda-12`) libraries are
missing; otherwise it installs the CPU package and prints the corrective
action. Use `LLM_CONTEXT_ACCELERATOR_PACKAGE=auto`, `cpu`, or `cuda` to choose
explicitly. Inspect or repair the host later with:
12 runtime (`cuda-cudart-12-9`), CUDA math libraries (`cuda-libraries-12-9`,
including cuBLAS/cuRAND), and cuDNN 9 (`cudnn9-cuda-12`) libraries are missing;
otherwise it installs the CPU package and prints the corrective action. Use
`LLM_CONTEXT_ACCELERATOR_PACKAGE=auto`, `cpu`, or `cuda` to choose explicitly.
Inspect or repair the host later with:

```bash
llm-context setup
Expand All @@ -74,7 +75,7 @@ curl -fsSL https://raw.githubusercontent.com/devame/llm-context-tools/main/insta
| LLM_CONTEXT_SKIP_SEMANTIC=1 sh
```

Set `LLM_CONTEXT_VERSION=0.12.6` to pin the current release. See the
Set `LLM_CONTEXT_VERSION=0.12.9` to pin the current release. See the
[installation and troubleshooting guide](docs/user-guide.md#installation-and-troubleshooting)
for custom locations, CUDA, and verified model packages.

Expand Down Expand Up @@ -261,7 +262,7 @@ around the same JAR:

```bash
npm pack
npm install --global ./llm-context-0.12.6.tgz
npm install --global ./llm-context-0.12.9.tgz
llm-context doctor
```

Expand Down
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[java.security MessageDigest]))

(def lib 'devame/llm-context)
(def version "0.12.6")
(def version "0.12.9")
(def class-dir "target/classes")
(def basis (delay (b/create-basis {:project "deps.edn"})))
(def uber-file (format "target/llm-context-%s-standalone.jar" version))
Expand Down
1,197 changes: 1,197 additions & 0 deletions docs/decisions/2026-08-19_queue-aware-semantic-ingestion.md

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,15 @@ llm-context doctor
```

`setup` reports the visible GPU, NVIDIA driver version, minimum supported
driver (`525.60.13` for the CUDA 12 package), `libcuda.so.1`, CUDA 12, and
cuDNN 9. These are static host checks; the first semantic service startup is
still the authoritative runtime probe. If it finds missing CUDA 12 or cuDNN
packages on Debian/Ubuntu, setup offers:
driver (`525.60.13` for the CUDA 12 package), `libcuda.so.1`, CUDA 12, the CUDA
math libraries used by ONNX Runtime (cuBLAS/cuRAND), and cuDNN 9. These are
static host checks; the first semantic service startup is still the
authoritative runtime probe. If it finds missing CUDA packages on Debian/Ubuntu,
setup offers:

```bash
sudo apt-get update && sudo apt-get -y install cuda-cudart-12-9 cudnn9-cuda-12
sudo apt-get update && sudo apt-get -y install \
cuda-cudart-12-9 cuda-libraries-12-9 cudnn9-cuda-12
```

Use `llm-context setup --install-cudnn --yes` after authenticating with sudo and
Expand All @@ -346,9 +348,10 @@ do not install a Linux NVIDIA driver inside WSL.
On Linux x86-64, `install.sh` defaults to
`LLM_CONTEXT_ACCELERATOR_PACKAGE=auto`. When a visible GPU and compatible
driver are present, the installer asks whether it should install whichever of
`cuda-cudart-12-9` and `cudnn9-cuda-12` is missing, using `apt-get` and `sudo`
when needed. A declined prompt, a non-interactive terminal, or an unavailable
package manager falls back to the CPU package and prints the corrective action.
`cuda-cudart-12-9`, `cuda-libraries-12-9`, and `cudnn9-cuda-12` is missing, using
`apt-get` and `sudo` when needed. A declined prompt, a non-interactive terminal,
or an unavailable package manager falls back to the CPU package and prints the
corrective action.
Set `LLM_CONTEXT_CUDA_INSTALL=yes` or `no` for automation;
`LLM_CONTEXT_CUDNN_INSTALL` remains accepted as a compatibility alias. Use
`LLM_CONTEXT_ACCELERATOR_PACKAGE=cpu` to force CPU or
Expand Down
34 changes: 32 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ verify_hash() {

CUDA_MINIMUM_DRIVER="525.60.13"
CUDA_RUNTIME_PACKAGE="cuda-cudart-12-9"
CUDA_LIBRARIES_PACKAGE="cuda-libraries-12-9"
CUDA_CUDNN_PACKAGE="cudnn9-cuda-12"

version_at_least() {
Expand Down Expand Up @@ -129,6 +130,9 @@ cuda_library_present() {
for candidate in \
"/usr/lib/wsl/lib/$library" \
"/usr/local/cuda/lib64/$library" \
"/usr/local/cuda/targets/x86_64-linux/lib/$library" \
"/usr/local/cuda-12.9/lib64/$library" \
"/usr/local/cuda-12.9/targets/x86_64-linux/lib/$library" \
"/usr/lib/x86_64-linux-gnu/$library" \
"/usr/lib64/$library"; do
if [ -f "$candidate" ]; then
Expand All @@ -151,6 +155,7 @@ cuda_host_preflight() {
CUDA_DEVICE_VISIBLE=0
CUDA_LIBCUDA_PRESENT=0
CUDA_RUNTIME_PRESENT=0
CUDA_LIBRARIES_PRESENT=0
CUDA_CUDNN_PRESENT=0

if [ -n "$CUDA_NVIDIA_SMI" ]; then
Expand Down Expand Up @@ -184,6 +189,10 @@ cuda_host_preflight() {
if cuda_library_present libcudart.so.12; then
CUDA_RUNTIME_PRESENT=1
fi
if cuda_library_present libcublasLt.so.12 &&
cuda_library_present libcurand.so.10; then
CUDA_LIBRARIES_PRESENT=1
fi
if cuda_library_present libcudnn.so.9; then
CUDA_CUDNN_PRESENT=1
fi
Expand All @@ -193,6 +202,7 @@ cuda_host_preflight() {
[ "$CUDA_DRIVER_COMPATIBLE" -eq 1 ] &&
[ "$CUDA_LIBCUDA_PRESENT" -eq 1 ] &&
[ "$CUDA_RUNTIME_PRESENT" -eq 1 ] &&
[ "$CUDA_LIBRARIES_PRESENT" -eq 1 ] &&
[ "$CUDA_CUDNN_PRESENT" -eq 1 ]; then
CUDA_HOST_READY=1
else
Expand All @@ -201,13 +211,14 @@ cuda_host_preflight() {
}

print_cuda_host_preflight() {
printf 'GPU preflight: GPU=%s; device=%s; driver=%s (minimum %s); libcuda=%s; CUDA 12 runtime=%s; cuDNN 9=%s\n' \
printf 'GPU preflight: GPU=%s; device=%s; driver=%s (minimum %s); libcuda=%s; CUDA 12 runtime=%s; CUDA libraries=%s; cuDNN 9=%s\n' \
"${CUDA_GPU_NAME:-not detected}" \
"$(if [ "$CUDA_DEVICE_VISIBLE" -eq 1 ]; then printf visible; else printf missing; fi)" \
"${CUDA_DRIVER_VERSION:-not detected}" \
"$CUDA_MINIMUM_DRIVER" \
"$(if [ "$CUDA_LIBCUDA_PRESENT" -eq 1 ]; then printf present; else printf missing; fi)" \
"$(if [ "$CUDA_RUNTIME_PRESENT" -eq 1 ]; then printf present; else printf missing; fi)" \
"$(if [ "$CUDA_LIBRARIES_PRESENT" -eq 1 ]; then printf present; else printf missing; fi)" \
"$(if [ "$CUDA_CUDNN_PRESENT" -eq 1 ]; then printf present; else printf missing; fi)"
}

Expand All @@ -225,6 +236,10 @@ print_cuda_host_actions() {
printf 'Action: install or expose the CUDA 12 runtime (libcudart.so.12; package %s).\n' \
"$CUDA_RUNTIME_PACKAGE"
fi
if [ "$CUDA_LIBRARIES_PRESENT" -eq 0 ]; then
printf 'Action: install or expose CUDA 12 math libraries (libcublasLt.so.12 and libcurand.so.10; package %s).\n' \
"$CUDA_LIBRARIES_PACKAGE"
fi
if [ "$CUDA_DEVICE_VISIBLE" -eq 1 ] &&
[ "$CUDA_DRIVER_PRESENT" -eq 1 ] &&
[ "$CUDA_DRIVER_COMPATIBLE" -eq 1 ] &&
Expand Down Expand Up @@ -402,6 +417,11 @@ cuda_configure_apt_repositories() {
"$CUDA_RUNTIME_PACKAGE" >&2
return 1
}
cuda_apt_package_available "$CUDA_LIBRARIES_PACKAGE" || {
printf 'ERROR: NVIDIA CUDA repository still has no candidate for %s.\n' \
"$CUDA_LIBRARIES_PACKAGE" >&2
return 1
}
cuda_apt_package_available "$CUDA_CUDNN_PACKAGE" || {
printf 'ERROR: NVIDIA CUDA repository still has no candidate for %s.\n' \
"$CUDA_CUDNN_PACKAGE" >&2
Expand Down Expand Up @@ -437,12 +457,21 @@ maybe_install_cuda_dependencies() {
[ "$CUDA_DEVICE_VISIBLE" -eq 1 ] &&
[ "$CUDA_DRIVER_PRESENT" -eq 1 ] &&
[ "$CUDA_DRIVER_COMPATIBLE" -eq 1 ] &&
{ [ "$CUDA_RUNTIME_PRESENT" -eq 0 ] || [ "$CUDA_CUDNN_PRESENT" -eq 0 ]; } || return 0
{ [ "$CUDA_RUNTIME_PRESENT" -eq 0 ] ||
[ "$CUDA_LIBRARIES_PRESENT" -eq 0 ] ||
[ "$CUDA_CUDNN_PRESENT" -eq 0 ]; } || return 0

CUDA_INSTALL_PACKAGES=""
if [ "$CUDA_RUNTIME_PRESENT" -eq 0 ]; then
CUDA_INSTALL_PACKAGES="$CUDA_RUNTIME_PACKAGE"
fi
if [ "$CUDA_LIBRARIES_PRESENT" -eq 0 ]; then
if [ -n "$CUDA_INSTALL_PACKAGES" ]; then
CUDA_INSTALL_PACKAGES="$CUDA_INSTALL_PACKAGES $CUDA_LIBRARIES_PACKAGE"
else
CUDA_INSTALL_PACKAGES="$CUDA_LIBRARIES_PACKAGE"
fi
fi
if [ "$CUDA_CUDNN_PRESENT" -eq 0 ]; then
if [ -n "$CUDA_INSTALL_PACKAGES" ]; then
CUDA_INSTALL_PACKAGES="$CUDA_INSTALL_PACKAGES $CUDA_CUDNN_PACKAGE"
Expand Down Expand Up @@ -536,6 +565,7 @@ if [ "$INSTALL_SEMANTIC" -eq 1 ]; then
print_cuda_host_actions
fail "CUDA was requested but the host preflight is incomplete; fix the reported prerequisites or set LLM_CONTEXT_ACCELERATOR_PACKAGE=cpu"
}
RUNTIME_FLAVOR=cuda
elif [ "$RUNTIME_FLAVOR_REQUESTED" = "auto" ]; then
cuda_host_preflight
maybe_install_cuda_dependencies
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "llm-context",
"version": "0.12.6",
"version": "0.12.9",
"description": "Datalevin-backed semantic code graph and context generator for AI assistants",
"type": "module",
"bin": {
Expand Down
3 changes: 2 additions & 1 deletion resources/llm_context/dependencies.edn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; agree with this file; script/verify-dependencies.clj enforces that rule.
:project
{:name "llm-context"
:version "0.12.6"
:version "0.12.9"
:repository "devame/llm-context-tools"}

:toolchain
Expand Down Expand Up @@ -85,6 +85,7 @@
:cudnn-version "9"
:minimum-driver "525.60.13"
:runtime-debian-package "cuda-cudart-12-9"
:libraries-debian-package "cuda-libraries-12-9"
:debian-package "cudnn9-cuda-12"}}

:github
Expand Down
34 changes: 27 additions & 7 deletions scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,9 @@ cuda_library_present() {
for candidate in \
"/usr/lib/wsl/lib/$library" \
"/usr/local/cuda/lib64/$library" \
"/usr/local/cuda/targets/x86_64-linux/lib/$library" \
"/usr/local/cuda-12.9/lib64/$library" \
"/usr/local/cuda-12.9/targets/x86_64-linux/lib/$library" \
"/usr/lib/x86_64-linux-gnu/$library" \
"/usr/lib64/$library"; do
[[ -f "$candidate" ]] && return 0
Expand All @@ -688,9 +691,11 @@ cuda_host_preflight() {
CUDA_DRIVER_PRESENT=0
CUDA_DRIVER_COMPATIBLE=0
CUDA_RUNTIME_PRESENT=0
CUDA_LIBRARIES_PRESENT=0
CUDA_CUDNN_PRESENT=0
CUDA_MINIMUM_DRIVER=$(cuda_manifest_value ':minimum-driver')
CUDA_RUNTIME_PACKAGE=$(cuda_manifest_value ':runtime-debian-package')
CUDA_LIBRARIES_PACKAGE=$(cuda_manifest_value ':libraries-debian-package')
CUDA_CUDNN_PACKAGE=$(cuda_manifest_value ':debian-package')

if [[ -n "$CUDA_NVIDIA_SMI" ]]; then
Expand All @@ -711,18 +716,23 @@ cuda_host_preflight() {
CUDA_DEVICE_VISIBLE=1
fi
cuda_library_present libcudart.so.12 && CUDA_RUNTIME_PRESENT=1 || true
if cuda_library_present libcublasLt.so.12 &&
cuda_library_present libcurand.so.10; then
CUDA_LIBRARIES_PRESENT=1
fi
cuda_library_present libcudnn.so.9 && CUDA_CUDNN_PRESENT=1 || true
}

cuda_host_report() {
printf 'GPU: %s; device: %s; NVIDIA driver: %s (%s, minimum %s); CUDA 12 runtime: %s; cuDNN 9: %s\n' \
printf 'GPU: %s; device: %s; NVIDIA driver: %s (%s, minimum %s); CUDA 12 runtime: %s; CUDA libraries: %s; cuDNN 9: %s\n' \
"${CUDA_GPU_NAME:-not detected}" \
"$([[ "$CUDA_DEVICE_VISIBLE" -eq 1 ]] && printf visible || printf missing)" \
"${CUDA_DRIVER_VERSION:-not detected}" \
"$([[ "$CUDA_DRIVER_PRESENT" -eq 0 ]] && printf missing || \
([[ "$CUDA_DRIVER_COMPATIBLE" -eq 1 ]] && printf compatible || printf too-old))" \
"$CUDA_MINIMUM_DRIVER" \
"$([[ "$CUDA_RUNTIME_PRESENT" -eq 1 ]] && printf present || printf missing)" \
"$([[ "$CUDA_LIBRARIES_PRESENT" -eq 1 ]] && printf present || printf missing)" \
"$([[ "$CUDA_CUDNN_PRESENT" -eq 1 ]] && printf present || printf missing)"
}

Expand Down Expand Up @@ -906,12 +916,17 @@ cuda_configure_apt_repositories() {
"$CUDA_RUNTIME_PACKAGE" >&2
return 1
}
cuda_apt_package_available "$CUDA_LIBRARIES_PACKAGE" || {
printf 'ERROR: NVIDIA CUDA repository still has no candidate for %s.\n' \
"$CUDA_LIBRARIES_PACKAGE" >&2
return 1
}
cuda_apt_package_available "$CUDA_CUDNN_PACKAGE" || {
printf 'ERROR: NVIDIA CUDA repository still has no candidate for %s.\n' \
"$CUDA_CUDNN_PACKAGE" >&2
return 1
}
notify "NVIDIA CUDA repositories configured; both package candidates are available."
notify "NVIDIA CUDA repositories configured; all required package candidates are available."
}

cuda_host_step() {
Expand All @@ -928,8 +943,10 @@ cuda_host_step() {
notify "CUDA host installation not offered: a visible GPU and compatible NVIDIA driver are required."
return 0
fi
if [[ "$CUDA_RUNTIME_PRESENT" -eq 1 && "$CUDA_CUDNN_PRESENT" -eq 1 ]]; then
notify "CUDA 12 runtime and cuDNN 9 host libraries verified."
if [[ "$CUDA_RUNTIME_PRESENT" -eq 1 &&
"$CUDA_LIBRARIES_PRESENT" -eq 1 &&
"$CUDA_CUDNN_PRESENT" -eq 1 ]]; then
notify "CUDA 12 runtime, CUDA math libraries, and cuDNN 9 host libraries verified."
return 0
fi
if [[ "$ACTION" != install ]]; then
Expand All @@ -939,6 +956,7 @@ cuda_host_step() {

cuda_install_packages=()
[[ "$CUDA_RUNTIME_PRESENT" -eq 1 ]] || cuda_install_packages+=("$CUDA_RUNTIME_PACKAGE")
[[ "$CUDA_LIBRARIES_PRESENT" -eq 1 ]] || cuda_install_packages+=("$CUDA_LIBRARIES_PACKAGE")
[[ "$CUDA_CUDNN_PRESENT" -eq 1 ]] || cuda_install_packages+=("$CUDA_CUDNN_PACKAGE")
printf 'CUDA action: install missing host packages: %s\n' \
"${cuda_install_packages[*]}"
Expand Down Expand Up @@ -984,11 +1002,13 @@ cuda_host_step() {
retry "Install CUDA host packages" 2 5 sudo apt-get -y install "${cuda_install_packages[@]}"
fi
cuda_host_preflight
[[ "$CUDA_RUNTIME_PRESENT" -eq 1 && "$CUDA_CUDNN_PRESENT" -eq 1 ]] || {
printf 'ERROR: CUDA host package command completed but libcudart.so.12/cuDNN 9 verification failed.\n' >&2
[[ "$CUDA_RUNTIME_PRESENT" -eq 1 &&
"$CUDA_LIBRARIES_PRESENT" -eq 1 &&
"$CUDA_CUDNN_PRESENT" -eq 1 ]] || {
printf 'ERROR: CUDA host package command completed but libcudart.so.12, CUDA math libraries, or cuDNN 9 verification failed.\n' >&2
return 1
}
notify "Verified libcudart.so.12 and libcudnn.so.9 after installation."
notify "Verified libcudart.so.12, CUDA math libraries, and libcudnn.so.9 after installation."
}

local_native_platform() {
Expand Down
Loading
Loading