Skip to content

perf(docker): switch :cuda base to nvidia/cuda:12.4.0-runtime#19

Merged
oldhero5 merged 1 commit into
mainfrom
perf/cuda-runtime-base-on-fix
May 25, 2026
Merged

perf(docker): switch :cuda base to nvidia/cuda:12.4.0-runtime#19
oldhero5 merged 1 commit into
mainfrom
perf/cuda-runtime-base-on-fix

Conversation

@oldhero5

Copy link
Copy Markdown
Owner

Summary

Switch `Dockerfile.cuda` base from `nvidia/cuda:12.4.0-devel-ubuntu22.04` to `nvidia/cuda:12.4.0-runtime-ubuntu22.04`. We ship prebuilt CUDA torch wheels and never invoke nvcc, so the devel base's CUDA SDK + headers (~2.5 GB compressed, ~5 GB local) was carried for nothing.

Result on this machine

Before After
Local image size 13.6 GB 8.69 GB
Reduction -36% (-4.9 GB)
`torch.cuda.is_available()` True True
2048×2048 GPU matmul on `cuda:0` OK OK

Beats the issue's "2-3 GB" projection. Compressed size on Docker Hub should drop in the same ratio (yesterday's `:cuda` was 7.4 GB compressed → expect ~4.5 GB).

Why this could have been risky (it wasn't)

`runtime` strips nvcc + CUDA headers, which would break any path that does runtime JIT (`torch.compile`, custom kernels, some FlashAttention paths). Smoke test confirmed nothing in our SAM3 + YOLO inference path triggers JIT, so the wheels' bundled `.so`s are sufficient.

Builds on top of #18 which fixed the underlying libcudnn install — this PR is now just the one-line base swap the issue scoped.

Test plan

  • Local build succeeds on this branch
  • `import torch`; `torch.cuda.is_available()` is True
  • GPU matmul executes on cuda:0
  • Image size drops from 13.6 GB → 8.69 GB
  • CI `test` workflow passes
  • CI `release` workflow republishes `:main-cuda`; verify smaller size on Hub
  • Smoke a real labeling job to confirm no JIT-only kernel is hidden in the pipeline

Closes #8.

🤖 Generated with Claude Code

Cuts the local image from 13.6 GB to 8.69 GB (~36% / 4.9 GB saved). The
published compressed size will drop accordingly. We ship prebuilt CUDA
torch wheels and never invoke nvcc, so the devel base's CUDA SDK was
pure dead weight.

Verified locally on this machine (RTX 5000 Ada):
- Image builds clean
- `import torch` succeeds; torch.cuda.is_available() is True
- 2048x2048 matmul on cuda:0 works (no JIT/nvcc requirement surfaced)

Builds on top of #18 which fixed the underlying libcudnn install — this
is now just the one-line base swap the issue scoped.

Closes #8.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oldhero5
oldhero5 merged commit 868ec56 into main May 25, 2026
1 check passed
@oldhero5
oldhero5 deleted the perf/cuda-runtime-base-on-fix branch May 25, 2026 11:00
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.

Switch Dockerfile.cuda base from cuda:12.4-devel to cuda:12.4-runtime

1 participant