Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ or build multiple variants of a conda package which each target one or a subset
devices.

Similar to how the virtual package `__cuda` constrains the `cuda-version` metapackage to
represents to conda the CUDA *driver* version available on the system. This plugin creates a
represents to conda the CUDA *driver* version available on the system. This plugin creates
the virtual package `__cuda_arch` which constrains the `cuda-arch` metapackage which
represents to conda the minimum compute capability of all CUDA *devices* on the system.

## The `cuda-arch` metapackage

Recipes and packages cannot depend on a specific version of `__cuda` or `__cuda_arch`
directly we need to be able to build multiple variants of a package on the same machine
without changing the hardware or driver. Creating a wrapper metapackage like `cuda-version`
or `cuda-arch` which is only `run_constrained` by the corresponding virtual package lets us
do this.
directly because we need to be able to build multiple variants of a package on the same
machine without changing the hardware or driver. Creating a wrapper metapackage like
`cuda-version` or `cuda-arch` which is only `run_constrained` by the corresponding virtual
package lets us do this.

> [!IMPORTANT]
> This plugin does not create the `cuda-arch` metapackage. This package must be created
Expand All @@ -32,6 +32,10 @@ package:
name: cuda-arch
version: {{ version }}

build:
run_exports:
- cuda-arch >={{ version }}

requirements:
run_constrained:
- __cuda_arch {{ version }}
Expand All @@ -41,7 +45,7 @@ One version is published for every known major-minor compute capability. Sub-arc
such as `100f` are not expressible within this framework but can still be targeted at build
time.

## Implementing a conda-recipe which depends on `__cuda_arch`
## Implementing a conda-recipe which depends on `cuda-arch`

Define a `conda_build_config.yaml` to configure conda-build to build the recipe multiple
times. This file will need variables providing the compiler flags, compute capabilities, and
Expand Down Expand Up @@ -127,11 +131,9 @@ requirements:
- {{ compiler('cuda') }}
- {{ stdlib('c') }}
host:
# We must pin cuda-arch in the host environment to ensure that dependencies are also
# compatible with the desired cuda-arch
# We must pin cuda-arch in the host environment to the minimum supported cuda-arch to
# ensure that dependencies are also compatible with the minimum supported cuda-arch
- cuda-arch {{ cuda_arch_min }}
run:
- cuda-arch >={{ cuda_arch_min }}

```

Expand Down