From 7787be9ef84edcc44749c67440e2647e6b07ae97 Mon Sep 17 00:00:00 2001 From: Ryusei Nishide Date: Fri, 7 Aug 2026 15:09:03 +0900 Subject: [PATCH] fix: mock CUDA virtual package in GPU-less CI for pixi >= 0.76 pixi 0.76 introduced a build dispatch machine check when solving pypi requirements: the current machine must satisfy the workspace's system-requirements. GPU-less GitHub runners cannot provide __cuda >= 12.6, so every ubuntu pixi job started failing with 'build dispatch initialization failed: the workspace does not support linux-64 on this machine'. Set CONDA_OVERRIDE_CUDA (pixi's documented mechanism for mocking missing virtual packages) in the template repo CI and in the generated projects' CI/test workflows for pixi. The generated workflows derive the CUDA version from the selected pytorch_cuda_preset (or the custom cuda_version answer). Verified in a linux/amd64 container with pixi 0.76.1: 'pixi lock' reproduces the CI failure without the override and succeeds with it, for both the plain and PyTorch Geometric configurations. Co-Authored-By: Claude Fable 5 --- .github/workflows/ci.yml.jinja | 8 ++++++++ .github/workflows/test-template.yml | 6 ++++++ .github/workflows/test.yml.jinja | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml.jinja b/.github/workflows/ci.yml.jinja index 828fdbd..0229be1 100755 --- a/.github/workflows/ci.yml.jinja +++ b/.github/workflows/ci.yml.jinja @@ -1,3 +1,4 @@ +{%- set effective_cuda_version = cuda_version if pytorch_cuda_preset == 'custom' else pytorch_cuda_preset.split('-cuda-')[1] -%} name: CI on: @@ -5,6 +6,13 @@ on: branches: [main] pull_request: branches: [main] +{%- if package_manager == "pixi" %} + +env: + # GPU-less runners cannot satisfy the cuda system-requirement; + # pixi >= 0.76 refuses to solve without this mock. + CONDA_OVERRIDE_CUDA: "{{ effective_cuda_version }}" +{%- endif %} jobs: {%- if use_ruff or use_ty %} diff --git a/.github/workflows/test-template.yml b/.github/workflows/test-template.yml index fe03466..5b8b232 100755 --- a/.github/workflows/test-template.yml +++ b/.github/workflows/test-template.yml @@ -6,6 +6,12 @@ on: pull_request: workflow_dispatch: +env: + # GPU-less runners cannot satisfy the generated project's cuda + # system-requirement; pixi >= 0.76 refuses to solve without this mock. + # Keep in sync with the CUDA version of the matrix pytorch-presets. + CONDA_OVERRIDE_CUDA: "12.6" + jobs: test-generation: name: Test Template Generation diff --git a/.github/workflows/test.yml.jinja b/.github/workflows/test.yml.jinja index dad2ac3..19be54b 100755 --- a/.github/workflows/test.yml.jinja +++ b/.github/workflows/test.yml.jinja @@ -1,3 +1,4 @@ +{%- set effective_cuda_version = cuda_version if pytorch_cuda_preset == 'custom' else pytorch_cuda_preset.split('-cuda-')[1] -%} name: Tests on: @@ -5,6 +6,13 @@ on: branches: [main] pull_request: branches: [main] +{%- if package_manager == "pixi" %} + +env: + # GPU-less runners cannot satisfy the cuda system-requirement; + # pixi >= 0.76 refuses to solve without this mock. + CONDA_OVERRIDE_CUDA: "{{ effective_cuda_version }}" +{%- endif %} jobs: {%- if use_pytest %}