Skip to content

fix: add non-free apt sources for nvidia-cuda-toolkit on Bookworm#2057

Open
harshmathurx wants to merge 2 commits into
unclecode:developfrom
harshmathurx:fix/gpu-dockerfile-non-free
Open

fix: add non-free apt sources for nvidia-cuda-toolkit on Bookworm#2057
harshmathurx wants to merge 2 commits into
unclecode:developfrom
harshmathurx:fix/gpu-dockerfile-non-free

Conversation

@harshmathurx

@harshmathurx harshmathurx commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The python:3.12-slim-bookworm base image only has main and non-free-firmware components enabled. nvidia-cuda-toolkit lives in non-free, and some of its install-time dependencies resolve from contrib, so the GPU Docker build needs both components enabled before installing it.

This PR adds deb http://deb.debian.org/debian bookworm contrib non-free to sources.list before the GPU install block so ENABLE_GPU=true builds don't fail with:

Package nvidia-cuda-toolkit has no installation candidate

Also fixes a stray trailing space after apt-get clean \.

Fixes #2020.

Validation:

  • Simulated Bookworm apt sources matching the slim image (main non-free-firmware + this added source).
  • apt-cache policy nvidia-cuda-toolkit finds candidate 11.8.89~11.8.0-5~deb12u1.
  • apt-get install -s --no-install-recommends nvidia-cuda-toolkit resolves successfully with contrib non-free; it fails with non-free alone due missing dependencies.

The python:3.12-slim-bookworm base image only has main and
non-free-firmware components enabled. nvidia-cuda-toolkit lives in
non-free, which is not included by default in Debian Bookworm slim
images.

Add deb http://deb.debian.org/debian bookworm non-free to sources.list
before the GPU install block so ENABLE_GPU=true builds don't fail with
"Package has no installation candidate".

Also fixes a stray trailing space after apt-get clean.

Fixes unclecode#2020
@harshmathurx harshmathurx changed the base branch from main to develop July 8, 2026 16:43
@harshmathurx

Copy link
Copy Markdown
Contributor Author

@ntohidi gentle ping for review when you have a moment. I have retargeted this to develop and updated the apt source to contrib non-free after validating that non-free alone makes nvidia-cuda-toolkit visible but still leaves dependency resolution broken in a Bookworm slim-style apt simulation.

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.

[Bug]: Package 'nvidia-cuda-toolkit' has no installation candidate

1 participant