Skip to content

Commit 91dadd4

Browse files
committed
Build cuda wheels
1 parent 14c901c commit 91dadd4

6 files changed

Lines changed: 28 additions & 26 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ build/
33
.vscode/
44
__pycache__/
55
qoco_custom*/
6-
src/bindings.cpp
6+
src/bindings.cpp
7+
dist/

Dockerfile.cuda-manylinux

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Base manylinux image with Python interpreters
2+
FROM quay.io/pypa/manylinux_2_28_x86_64:2025.11.09-2
3+
4+
# Install prerequisites
5+
RUN yum install -y wget tar bzip2 xz gzip make gcc gcc-c++ git
6+
7+
# Install CUDA Toolkit 13.1 and cuDSS 0.7.1
8+
RUN wget https://developer.download.nvidia.com/compute/cuda/13.0.0/local_installers/cuda_13.0.0_580.65.06_linux.run && \
9+
sh cuda_13.0.0_580.65.06_linux.run --silent --toolkit && \
10+
rm cuda_13.0.0_580.65.06_linux.run && \
11+
curl -O https://developer.download.nvidia.com/compute/cudss/0.7.1/local_installers/cudss-local-repo-rhel10-0.7.1-0.7.1-1.x86_64.rpm && \
12+
rpm -i cudss-local-repo-rhel10-0.7.1-0.7.1-1.x86_64.rpm && \
13+
dnf clean all && \
14+
dnf -y install cudss
15+
16+
# Set CUDA environment variables
17+
ENV PATH=/usr/local/cuda/bin:$PATH
18+
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
19+
ENV CUDAToolkit_ROOT=/usr/local/cuda/bin

backend/cuda/cibuildwheel.toml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
[tool.cibuildwheel]
2-
build = "cp3*"
3-
skip = ["cp36-*", "cp37-*", "*-win32", "*-manylinux_i686", "*-musllinux_*"]
4-
build-verbosity = 1
5-
before-build = "rm -rf {package}/osqp_sources/build"
6-
repair-wheel-command = ""
7-
81
[tool.cibuildwheel.linux]
9-
before-all = [
10-
"yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo",
11-
"yum search cuda-toolkit*",
12-
"yum install -y cuda-toolkit-13-0"
13-
]
14-
environment = { CMAKE_CUDA_COMPILER = "/usr/local/cuda-13.0/bin/nvcc" }
2+
skip = ["*-musllinux*"]
3+
manylinux-x86_64-image = "mycuda-manylinux:latest"
4+
environment = { CUDAToolkit_ROOT = "/usr/local/cuda/bin" }

backend/cuda/pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@ dependencies = ["numpy>=1.7", "scipy>=0.13.2", "setuptools", "qoco>=0.2.0"]
1212

1313
[tool.scikit-build]
1414
install.components = ["python"]
15-
cmake.source-dir = "../.."
1615

1716
[tool.scikit-build.cmake.define]
1817
QOCO_ALGEBRA_BACKEND = "cuda"
1918
QOCO_EXT_MODULE_NAME = "qoco_cuda"
2019

2120
[project.urls]
2221
Homepage = "https://github.com/qoco-org/qoco"
23-
Issues = "https://github.com/qoco-org/qoco/issues"
24-
25-
[tool.setuptools_scm]
26-
root = "../.."
22+
Issues = "https://github.com/qoco-org/qoco/issues"

build_cuda_wheels.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mv backend/cuda/pyproject.toml .
2+
docker build -f Dockerfile.cuda-manylinux -t mycuda-manylinux:latest .
3+
cibuildwheel --platform linux --output-dir dist --config-file backend/cuda/cibuildwheel.toml

requirements.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)