Skip to content

fix: add Pascal CUDA architectures#970

Open
nanookclaw wants to merge 1 commit into
docker:mainfrom
nanookclaw:fix/pascal-cuda-architectures
Open

fix: add Pascal CUDA architectures#970
nanookclaw wants to merge 1 commit into
docker:mainfrom
nanookclaw:fix/pascal-cuda-architectures

Conversation

@nanookclaw

Copy link
Copy Markdown

Summary

Closes #929.

This sets CMAKE_CUDA_ARCHITECTURES explicitly for the native llama.cpp CUDA build so the image includes Pascal targets sm_61 and sm_62. The list follows the issue's suggested architecture set and keeps the existing newer CUDA targets covered:

61;62;70;75;80;86;89;120;121

Without an explicit value, recent CUDA/CMake defaults can omit Pascal, which leaves GTX 10-series and similar cards without a compatible CUDA kernel and causes Docker Model Runner to fall back to CPU inference.

Validation

  • git diff --check
  • Confirmed the Dockerfile contains the architecture flag exactly once
  • Confirmed the semicolon-separated CMake list remains a single argument when passed through the existing cmake-flags command-substitution pattern

I did not run a full CUDA image build locally because that requires pulling the NVIDIA CUDA builder image and compiling llama.cpp; there does not appear to be a focused lightweight Dockerfile flag test in this repo.

Signed-off-by: Nanook Claw <nanook@agentmail.to>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures CUDA architectures in the Dockerfile for llamacpp. However, the specified architectures '120' and '121' are invalid and will cause compilation to fail, while the important Hopper architecture ('90') is missing. The reviewer recommends updating the list to use valid compute capabilities.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

-DGGML_NATIVE=OFF \
-DGGML_OPENMP=OFF \
-DGGML_CUDA=ON \
-DCMAKE_CUDA_ARCHITECTURES=61;62;70;75;80;86;89;120;121 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The CUDA architectures 120 and 121 are invalid. CUDA compute capabilities (architectures) do not go up to 120 or 121; these numbers likely confuse CUDA software versions (12.0, 12.1) with GPU architectures. Passing these invalid values will cause nvcc to fail during compilation with an error like nvcc fatal : Unsupported gpu architecture 'compute_120'.

Additionally, the list is missing Hopper (90), which is a highly important enterprise GPU architecture (e.g., NVIDIA H100).

Please update the list to use valid compute capabilities, such as 61;62;70;75;80;86;89;90.

    -DCMAKE_CUDA_ARCHITECTURES=61;62;70;75;80;86;89;90 \
References
  1. Focus on correctness, safety, and maintainability — in that order. Critical issues include correctness bugs. (link)

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Hard-coding CMAKE_CUDA_ARCHITECTURES in the Dockerfile makes it harder to support future GPU generations; consider wiring this through a build ARG or environment variable so the list can be overridden without editing the image definition.
  • Since the semicolon-separated architectures are passed through shell and command substitution, it may be safer to either quote the -DCMAKE_CUDA_ARCHITECTURES=... argument or document this behavior near the cmake-flags usage to avoid accidental word-splitting changes in future edits.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Hard-coding `CMAKE_CUDA_ARCHITECTURES` in the Dockerfile makes it harder to support future GPU generations; consider wiring this through a build ARG or environment variable so the list can be overridden without editing the image definition.
- Since the semicolon-separated architectures are passed through shell and command substitution, it may be safer to either quote the `-DCMAKE_CUDA_ARCHITECTURES=...` argument or document this behavior near the `cmake-flags` usage to avoid accidental word-splitting changes in future edits.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ericcurtin

Copy link
Copy Markdown
Contributor

Eventually we should use to using llama.cpp artefacts from llama.cpp directly... We will support whatever they deem suitable to support...

@ilopezluna PTAL

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.

Add Pascal GPU (sm_61/sm_62) support to llama.cpp CUDA build

2 participants