perf(docker): switch :cuda base to nvidia/cuda:12.4.0-runtime#19
Merged
Conversation
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>
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.
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
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
Closes #8.
🤖 Generated with Claude Code