Skip to content

chore: Migrate Pixi system-requirements to custom platforms#43

Draft
matthewfeickert wants to merge 14 commits into
CHTC:masterfrom
matthewfeickert:chore/migrate-system-requirements-to-rich-platforms
Draft

chore: Migrate Pixi system-requirements to custom platforms#43
matthewfeickert wants to merge 14 commits into
CHTC:masterfrom
matthewfeickert:chore/migrate-system-requirements-to-rich-platforms

Conversation

@matthewfeickert

@matthewfeickert matthewfeickert commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
  • In Pixi v0.71.0 the system-requirements table was deprecated for custom platforms in the main workspace table. Add a 'linux-64-cuda' platform to support features with CUDA.
  • Update requires-pixi to 0.71.0 to ensure rich platform support.
  • Note in the docs that users now need to remove platforms that do not support the custom platform's virtual packages, or that the custom platform needs to be explicitly given in the 'pixi add' command.

@matthewfeickert matthewfeickert changed the title chore: Migrate Pixi system-requirements to rich platforms chore: Migrate Pixi system-requirements to custom platforms Jul 2, 2026
@matthewfeickert matthewfeickert force-pushed the chore/migrate-system-requirements-to-rich-platforms branch from f759683 to c7e5f61 Compare July 2, 2026 08:45
Comment thread pixi/README.md
> pixi task add --description "Train a PyTorch CNN classifier on the MNIST dataset" train "python ./main.py --epochs 20 --save-model"
> pixi workspace platform add --cuda 12.9 linux-64-cuda=linux-64
> pixi add --platform linux-64-cuda pytorch-gpu torchvision 'cuda-version 12.9.*' --no-install
> pixi task add --platform linux-64-cuda --description "Train a PyTorch CNN classifier on the MNIST dataset" train "python ./main.py --epochs 20 --save-model"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note though that the semantics are now that one would need to run

pixi run --platform linux-64-cuda train

to have the task be found. pixi task add has --default-environment but it doesn't have --default-platform.

I'm not sure if this would be reasonable to request or not.

@matthewfeickert

Copy link
Copy Markdown
Contributor Author

For

condor_submit mnist_gpu.sub

the mnist_gpu_<id>_0.err.txt logs contain the output of

time pixi run python ./torch_detect_GPU.py

...
+ pixi run python ./torch_detect_GPU.py
 WARN Environment 'default' was resolved for a richer platform than 'linux-64' provides; this machine only meets the installed packages' minimum requirements, so it runs here by accident.

which shows that a Pixi is now resolving virtual packages from the machine doing the resolution (my laptop)

$ head -n 15 ./pixi.lock 
version: 7
platforms:
- name: p1
  subdir: linux-64
  virtual-packages:
  - __cuda=12.9
  - __unix=0=0
  - __linux=4.18
  - __glibc=2.28
  - __archspec=0=x86_64
environments:
  default:
    channels:
    - url: https://conda.anaconda.org/conda-forge/
    packages:
...

it might be necessary to make these virtual packages be more broad.

@matthewfeickert

Copy link
Copy Markdown
Contributor Author
...
+ pixi run python ./torch_detect_GPU.py
 WARN Environment 'default' was resolved for a richer platform than 'linux-64' provides; this machine only meets the installed packages' minimum requirements, so it runs here by accident.

seems to be due to it landing on CHTC jobs, from

# Require a machine with a modern version of the CUDA driver
requirements = (GPUs_DriverVersion >= 12.0)
# We must request 1 CPU in addition to 1 GPU
request_cpus = 1
request_gpus = 1
request_memory = 10GB
request_disk = 30GB
+WantGPULab = true
+GPUJobLength = "short"
# Specify the GPU hardware architecture required
# Check against the CUDA GPU Compute Capability for your software
# e.g. python -c "import torch; print(torch.cuda.get_arch_list())"
# The listed 'sm_xy' values show the x.y gpu capability supported
#
# Note that given
# https://github.com/conda-forge/cudnn-feedstock/issues/124
# there can be segfaults for cudnn>=9.11 on pre-Turing devices (<=sm_70)
# so use sm_70 as a safer lower bound
gpus_minimum_capability = 7.0

with

   Virtual packages: __unix=0=0
                   : __linux=5.14.0=0
                   : __glibc=2.34=0
                   : __cuda=12.8=0
                   : __archspec=1=cascadelake

when the environment is resolved to

  virtual-packages:
  - __cuda=12.9
  - __unix=0=0
  - __linux=4.18
  - __glibc=2.28
  - __archspec=0=x86_64

I think this either needs to have the submission areas tightened up to have more modern setups on CHTC or this should loosen the CUDA requirement to 12, which should be fine given how CUDA API/ABI works.

@matthewfeickert matthewfeickert force-pushed the chore/migrate-system-requirements-to-rich-platforms branch from e9f5ed4 to 9f90d0f Compare July 3, 2026 01:12
* In Pixi v0.71.0 the system-requirements table was deprecated for custom
  platforms in the main workspace table. Add a 'linux-64-cuda' platform
  to support features with CUDA.
   - c.f. https://pixi.prefix.dev/v0.71.3/workspace/system_requirements/
* Update requires-pixi to 0.71.0 to ensure rich platform support.
* Note in the docs that users now need to remove platforms that do not support
  the custom platform's virtual packages, or that the custom platform needs
  to be explicitly given in the 'pixi add' command.
HTCondor's container universe runs Docker images as the execute node's
slot uid, which has no /etc/passwd entry inside the container, and with
a scrubbed environment (no USER or LOGNAME set). Python's
getpass.getuser() then raises "OSError: No username set in the
environment", aborting 'import torchvision' when torch._inductor
resolves its cache directory (/tmp/torchinductor_<username>) at import
time.

Export fallback USER and LOGNAME (the numeric uid) in the generated
entrypoint.sh so getpass.getuser() resolves from the environment without
needing the passwd database, and fall back to a writable temporary
directory when HOME is unset or unwritable (Docker sets HOME=/ for
unknown uids), protecting workloads that write to ~/.cache (torch hub,
matplotlib, fontconfig).

Apptainer images are unaffected: Apptainer injects the invoking user's
passwd entry into the container at startup ('config passwd = yes'
default in apptainer.conf), so apptainer.def needs no change.
@matthewfeickert matthewfeickert force-pushed the chore/migrate-system-requirements-to-rich-platforms branch from f2bf916 to f6a102c Compare July 3, 2026 19:02
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.

1 participant