Skip to content

Align CUDA packages and images with driver-only runtime support - #31

Open
ndizazzo wants to merge 1 commit into
mainfrom
fix/cuda-driver-only-packages
Open

ndizazzo wants to merge 1 commit into
mainfrom
fix/cuda-driver-only-packages

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Why

Upstream 7370b61 packages cudart, cuBLAS, cuBLASLt, and nvJitLink into the native runtime and verifies that closure resolves with LD_LIBRARY_PATH unset, with the NVIDIA driver host-owned. Packaging still declared the distro's toolkit packages on top of it, which forces an NVIDIA apt repository on users for libraries the package already installs into its own versioned runtime tree.

What changed

  • Package metadata. Ubuntu CUDA Depends drops cuda-cudart-<series>, libcublas-<series>, and libnccl2. Arch CUDA .PKGINFO drops depend = cuda. Ubuntu CUDA now reads Depends: ca-certificates, libdbus-1-3, libgomp1, the same as CPU.
  • Runtime images. install-runtime-deps.sh installs nothing extra for CUDA on either distro. The NCCL version-hold dance goes with it, since it only existed to avoid upgrading the nvidia/cuda base's held NCCL. backend_version is no longer read by that script, so it no longer takes it.
  • Base images. ubuntu-cuda-12.9.2 and ubuntu-cuda-13.1.2 move from nvidia/cuda:*-runtime-ubuntu24.04 to ubuntu:24.04.
  • Docs. native-packages.md, gpu-runbooks.md, and matrix.md.

The part that isn't in the summary

The nvidia/cuda base was supplying NVIDIA_VISIBLE_DEVICES=all and NVIDIA_DRIVER_CAPABILITIES=compute,utility, which is what the container toolkit reads to inject the host driver. Dropping the base drops those, so GPU rows would regress. I confirmed against the real image config:

$ docker buildx imagetools inspect nvidia/cuda:12.9.2-runtime-ubuntu24.04 --format '{{json .Image}}'
... NVIDIA_VISIBLE_DEVICES=all, NVIDIA_DRIVER_CAPABILITIES=compute,utility ...

The matrix now derives both from backend === "cuda" and the runtime stage sets them from stage-local build args. My first attempt used a global ARG BACKEND to pick a backend-specific ENV stage; that trips release-specific inputs do not invalidate shared dependency stages, which forbids a global BACKEND ARG so the shared package-deps layer stays cached across backends. Build args respect that invariant.

arch-cuda-13.3.1 runs on archlinux:base and never had these variables at all. It gains them here.

NVIDIA_REQUIRE_CUDA is deliberately not replaced. The base image's value described its toolkit (cuda>=12.9 plus per-branch driver floors). The packaged runtime now carries its own toolkit closure, so re-declaring that floor would reject hosts that work. If we want a driver pre-flight gate back, the honest source is the runtime manifest's backend.cuda.min_driver.

QA

  • tests/native-package.test.ts: new fixture captures the real DEBIAN/control and .PKGINFO for Ubuntu and Arch CUDA and asserts no NVIDIA user-space package appears. I checked it isn't vacuous by re-adding cuda-cudart-12-9 and confirming it fails.
  • tests/package-build-efficiency.test.ts: CUDA rows install exactly the CPU dependency set on both distros, and nothing matching cudart|cublas|nccl is requested.
  • tests/image-matrix.test.ts: plain base and derived toolkit variables for CUDA rows, empty for CPU and ROCm. 100% lines/branches/functions held.
  • scripts/image-matrix.ts validate, actionlint, shellcheck, git diff --check, and buildx --check --target runtime for cpu/cuda/rocm/vulkan all clean.
  • Full suite: 160/163. Same 2 workflow-provenance failures as origin/main on macOS; they were green on ubuntu CI in Require producer-declared native runtime license files #30.

Not covered here

No GPU runner has exercised this. The claim that the packaged closure is sufficient rests on upstream's verification, not on a device test in this repo.

Summary by CodeRabbit

  • New Features

    • CUDA images now use standard Ubuntu bases while retaining required NVIDIA device and driver capability settings.
    • CUDA runtime packages provide their own user-space dependencies, reducing reliance on vendor-specific base images and host package repositories.
  • Documentation

    • Updated GPU, matrix, and native-package guidance to clarify CUDA runtime, driver, and package requirements.
  • Bug Fixes

    • Improved CUDA image configuration and dependency handling across Ubuntu and Arch builds.
    • Added validation to prevent unintended CUDA package dependencies.

Upstream now packages cudart, cuBLAS, cuBLASLt, and nvJitLink into the
native runtime and verifies that closure resolves with LD_LIBRARY_PATH
unset. Packaging still declared the distro's toolkit packages on top of
it, which forced an NVIDIA apt repository on users for libraries the
package already installs.

Drop cuda-cudart, libcublas, and libnccl2 from the Debian Depends and
cuda from the Arch PKGINFO, and stop installing them into runtime
images. Ubuntu CUDA rows now build on ubuntu:24.04 rather than
nvidia/cuda.

That base swap silently removes NVIDIA_VISIBLE_DEVICES and
NVIDIA_DRIVER_CAPABILITIES, which the container toolkit reads to inject
the host driver, so the matrix derives both from the row backend and the
runtime stage sets them. They are stage-local build args rather than a
global BACKEND ARG, which would invalidate the shared package tooling
layer. Arch CUDA ran on archlinux:base and never had these at all, so
that row gains them here.

NVIDIA_REQUIRE_CUDA is deliberately not replaced. It described the base
image's toolkit, and the packaged runtime now carries its own, so the
old floor would reject hosts that work. A driver gate, if we want one,
belongs to the runtime manifest's backend.cuda.min_driver.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9a4b2724-79bf-49a7-a7b9-c5279ee9910e

📥 Commits

Reviewing files that changed from the base of the PR and between d004918 and d2b04b3.

📒 Files selected for processing (14)
  • --mtime=1700000000``
  • .github/workflows/package-image-row.yml
  • TODO.md
  • docker/Dockerfile.mesh-llm
  • docker/install-runtime-deps.sh
  • docs/gpu-runbooks.md
  • docs/matrix.md
  • docs/native-packages.md
  • packaging/images.json
  • packaging/native/build-package.sh
  • scripts/image-matrix.ts
  • tests/image-matrix.test.ts
  • tests/native-package.test.ts
  • tests/package-build-efficiency.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

CUDA packages no longer install or declare NVIDIA user-space dependencies. CUDA images use plain distro bases, while the image matrix supplies NVIDIA runtime variables for CUDA rows and the runtime stage exports them.

Changes

CUDA driver-only runtime packaging

Layer / File(s) Summary
Remove CUDA user-space package dependencies
packaging/native/build-package.sh, docker/install-runtime-deps.sh, tests/native-package.test.ts, tests/package-build-efficiency.test.ts
CUDA package metadata and runtime dependency installation no longer add CUDA toolkit, cuBLAS, NCCL, or Arch cuda packages. Tests verify that CUDA dependencies match CPU dependencies and that package metadata contains no CUDA runtime dependencies.
Propagate NVIDIA runtime variables
packaging/images.json, scripts/image-matrix.ts, .github/workflows/package-image-row.yml, docker/Dockerfile.mesh-llm, tests/image-matrix.test.ts
Ubuntu CUDA rows use ubuntu:24.04. CUDA matrix rows set NVIDIA_VISIBLE_DEVICES to all and NVIDIA_DRIVER_CAPABILITIES to compute,utility; other rows use empty values. Workflow jobs pass these values to the runtime build, which exports them in the runtime stage.
Document the packaging model
docs/gpu-runbooks.md, docs/matrix.md, docs/native-packages.md, TODO.md
Documentation records native CUDA runtime packaging, plain distro bases, archive ABI labeling, host-owned drivers, and NVIDIA variable propagation. The production-readiness item is marked complete.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant matrixRows
  participant package-image-row
  participant Dockerfile.mesh-llm
  matrixRows->>package-image-row: Generate row JSON with NVIDIA variables
  package-image-row->>Dockerfile.mesh-llm: Pass NVIDIA build arguments
  Dockerfile.mesh-llm->>Dockerfile.mesh-llm: Export variables in the runtime stage
Loading

Merge Risk: ⚪ Minimal · up to d2b04

CUDA images now use the packaged native runtime with host-driver injection variables propagated from the image matrix. No actionable merge-blocking risk is established in the supplied change context.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. (7 skipped: 7 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: aligning CUDA package metadata and images with driver-only runtime support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cuda-driver-only-packages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ndizazzo

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants