@@ -18,12 +18,13 @@ This is the primary workflow that builds wheels for all supported configurations
1818- ** CUDA version** : 12.5 (for stable GPU support and features)
1919
2020#### Key Features:
21- 1 . Builds wheels for all Python versions in parallel on Linux
22- 2 . Automatically installs CUDA toolkit in manylinux container
23- 3 . Bundles CUDA libraries with wheels for standalone distribution
24- 4 . Runs basic import tests after building
25- 5 . Uploads wheels as GitHub Actions artifacts
26- 6 . Optionally publishes to PyPI on version tags
21+ 1 . Uses conda to manage CUDA 12.5 environment for reliable installation
22+ 2 . Builds wheels for all Python versions in parallel on Linux
23+ 3 . Automatically installs CUDA toolkit in manylinux container
24+ 4 . Bundles CUDA libraries with wheels for standalone distribution
25+ 5 . Runs basic import tests after building
26+ 6 . Uploads wheels as GitHub Actions artifacts
27+ 7 . Optionally publishes to PyPI on version tags
2728
2829### Simplified Workflow: ` build_wheels_simple.yml `
2930
@@ -54,12 +55,23 @@ Helper script for Windows wheels:
5455
5556### Prerequisites
5657
57- 1 . Install cibuildwheel :
58+ 1 . Install conda/mamba :
5859``` bash
59- pip install cibuildwheel
60+ # Install miniforge (includes mamba)
61+ curl -L -O " https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$( uname) -$( uname -m) .sh"
62+ bash Miniforge3-$( uname) -$( uname -m) .sh
63+ ```
64+
65+ 2 . Create CUDA environment:
66+ ``` bash
67+ mamba env create -f environment/environment-gpu.yml
68+ conda activate ccc-gpu
6069```
6170
62- 2 . Install CUDA Toolkit 12.5 (or compatible version)
71+ 3 . Install cibuildwheel:
72+ ``` bash
73+ pip install cibuildwheel
74+ ```
6375
6476### Build Commands
6577
@@ -73,21 +85,25 @@ Build specific Python version:
7385CIBW_BUILD=" cp311-*" cibuildwheel --output-dir wheelhouse
7486```
7587
76- Build with custom CUDA path (Linux) :
88+ Build with conda CUDA environment :
7789``` bash
78- export CUDA_HOME=/usr/local/cuda-12.5
90+ # Activate the conda environment with CUDA
91+ conda activate ccc-gpu
92+ # CUDA paths are automatically set by conda
7993cibuildwheel --output-dir wheelhouse
8094```
8195
8296## Platform-Specific Notes
8397
8498### Linux (manylinux)
8599
86- - Uses manylinux2014 base image for broad Linux distribution compatibility
87- - CUDA 12.5 is installed inside the container via yum package manager
100+ - Uses conda to install CUDA 12.5 on the host system for reliable setup
101+ - Uses manylinux2014 base image for broad Linux distribution compatibility
102+ - CUDA 12.5 is also installed inside the container via yum package manager
88103- Wheels are repaired with ` auditwheel ` to bundle CUDA shared libraries
89104- Resulting wheels are compatible with most Linux distributions (CentOS 7+, Ubuntu 16.04+, etc.)
90105- Supports x86_64 architecture only
106+ - Conda environment ensures consistent CUDA version across local and CI builds
91107
92108## CUDA Architecture Support
93109
@@ -119,8 +135,9 @@ To support additional architectures, modify the `CMAKE_CUDA_ARCHITECTURES` setti
119135### Common Issues
120136
1211371 . ** CUDA not found during build**
122- - Ensure CUDA_HOME/CUDA_PATH environment variable is set
123- - Verify CUDA toolkit version compatibility
138+ - Ensure conda environment is activated: ` conda activate ccc-gpu `
139+ - Verify CUDA installation: ` nvcc --version `
140+ - Check conda CUDA package: ` conda list cuda `
124141
1251422 . ** Wheel import fails with missing shared library**
126143 - Check auditwheel output for excluded libraries
@@ -134,6 +151,9 @@ To support additional architectures, modify the `CMAKE_CUDA_ARCHITECTURES` setti
134151
135152Enable verbose output:
136153``` bash
154+ # Ensure conda environment is active
155+ conda activate ccc-gpu
156+ # Enable verbose cibuildwheel output
137157CIBW_BUILD_VERBOSITY=3 cibuildwheel --output-dir wheelhouse
138158```
139159
0 commit comments