conda-incubator / conda-store

Data science environments, for collaboration. ✨
https://conda.store
BSD 3-Clause "New" or "Revised" License
144 stars 46 forks source link

Pass `CONDA_OVERRIDE_CUDA` to `with_cuda` of conda-lock #721

Closed nkaretnikov closed 8 months ago

nkaretnikov commented 9 months ago

Fixes #719.

Description

This pull request makes it possible to set the CUDA version by passing the value of the CONDA_OVERRIDE_CUDA specification variable to the with_cuda parameter of conda-lock.

See https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-virtual.html#overriding-detected-packages

How I tested this:

channels:
- conda-forge
dependencies:
- pytorch
- ipykernel
- pip:
  - nothing
description: test2
name: test3
prefix: null
variables:
  CONDA_OVERRIDE_CUDA: '12.0'
% CONDA_STORE_USERNAME=test CONDA_STORE_PASSWORD=password  python -m conda_store --conda-store-url="http://localhost:8080/conda-store/" --auth=basic run test/test3:4 -- python
>>> import torch
>>> torch.__file__
'/tmp/conda-store/4/lib/python3.12/site-packages/torch/__init__.py'
>>> print(torch.version.cuda)
12.0

This version matches the one in the lockfile, which comes from the variable. Note: I had to set the url when calling conda-store CLI in order to match the url used by the server when running via docker.

Pull request checklist

Additional information

netlify[bot] commented 9 months ago

Deploy Preview for kaleidoscopic-dango-0cf31d ready!

Name Link
Latest commit 8c9390c2c538cafd68b6080f9368e1b5af12d5e1
Latest deploy log https://app.netlify.com/sites/kaleidoscopic-dango-0cf31d/deploys/65a6ec80fa29ce00088fc76f
Deploy Preview https://deploy-preview-721--kaleidoscopic-dango-0cf31d.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

nkaretnikov commented 9 months ago

@amjames Do you have cycles to review this one?

nkaretnikov commented 9 months ago

@trallard Could you approve so I could merge? Andrew has reviewed this.

trallard commented 8 months ago

Added a non-blocking comment otherwise we can merge