Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install environment that lists cuda-specific features when on macOS #2443

Open
2 tasks done
ericmjl opened this issue Nov 9, 2024 · 3 comments
Open
2 tasks done

Comments

@ericmjl
Copy link

ericmjl commented Nov 9, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

pyproject.toml file:

[project]
name = "pixi-cuda-environment"
version = "0.1.0"
description = "Add a short description here"
authors = [{name = "Eric Ma", email = "[email protected]"}]
requires-python = ">= 3.11"
dependencies = ["pandas"]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]

# Feature Definitions
[tool.pixi.feature.cuda]
platforms = ["linux-64"]
system-requirements = {cuda = "12"}

[tool.pixi.feature.cuda.dependencies]
jaxlib = { version = "*", build = "*cuda12*" }

# Environments
[tool.pixi.environments]
cuda = ["cuda"]

When running pixi install, I get this error:

❯ pixi install
  × Unable to solve pypi dependencies for the cuda environment because no compatible python interpreter can be installed for the current
  │ platform
    ╭─[15:13]
 14 │ channels = ["conda-forge"]
 15 │ platforms = ["osx-arm64", "linux-64"]
    ·             ────────────┬────────────
    ·                         ╰── even though the projects does include support for 'osx-arm64'
 16 │ 
 17 │ 
 18 │ [tool.pixi.tasks]
 19 │ test = "pytest"
 20 │ 
 21 │ [tool.pixi.dependencies]
 22 │ ruff = ">=0.5.5,<0.6"
 23 │ pytest = ">=8.3.2,<8.4"
 24 │ ipython = ">=8.26.0,<9"
 25 │ jax = ">=0.4.28"
 26 │ pytest-cov = ">=5.0.0,<6"
 27 │ 
 28 │ # Feature Definitions
 29 │ [tool.pixi.feature.cuda]
 30 │ platforms = ["linux-64"]
    ·             ──────┬─────
    ·                   ╰── feature 'cuda' does not support 'osx-arm64'
 31 │ system-requirements = {cuda = "12"}
    ╰────
  help: Try converting your [pypi-dependencies] to conda [dependencies]

Issue description

It appears that I cannot install environments when I specify my pyproject.toml as above.

My goal is to support both osx-arm64 and linux-64 environments, and I want the CUDA environment to be installed only on linux-64. An additional requirement is that my project is also a distributable Python package, and I need to be able to specify dependencies in the project.dependencies section rather than tool.pixi.dependencies section, so that when others pip-install the package they can also pull in the necessary dependencies.

Expected behavior

Based on my mental model, pixi should have just proceeded with the install. After all, I have defined the cuda feature to be linux-64 only!

@ericmjl
Copy link
Author

ericmjl commented Nov 9, 2024

I'll note that when I move the dependencies from the project table to the tool.pixi.dependencies table, solving works, but this means my project no longer can be reliably distributed to across macOS, linux(+CUDA), and linux(-CUDA) as a pypi-installable package.

@ericmjl
Copy link
Author

ericmjl commented Nov 9, 2024

(Apologies for many posts, I'm quite literally thinking while writing on issue trackers.)

I realize I have a self-contradiction here based on my own dependency specification. Runtime dependencies, which are what I desire to pull in from pypi, should be specified under the [project] table, and this will include jaxlib. In other words, I need to separate out the [cuda] dependencies via optional dependencies rather than by pixi, I think.

@ruben-arts
Copy link
Contributor

Hey @ericmjl, thanks for your report. This issue is well known and we've actually just prepared a design to conquer this: #1340

If you that correctly fixes your issue, could you then close this issue in favor of that?

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

No branches or pull requests

2 participants