-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-native-windows-wheels.yml
More file actions
155 lines (136 loc) · 5.1 KB
/
Copy pathbuild-native-windows-wheels.yml
File metadata and controls
155 lines (136 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build native Windows wheels
on:
workflow_dispatch:
inputs:
release_tag:
description: GitHub Release tag for uploaded native wheels
required: true
default: native-wheels-torch270-cu128-v1
upload_release:
description: Upload wheels and license files to the release after a successful build
required: true
type: boolean
default: false
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.python-abi }} Windows wheels
runs-on: windows-2022
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
include:
- python-version: '3.11'
python-abi: cp311
- python-version: '3.12'
python-abi: cp312
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Conda for CUDA packages
uses: conda-incubator/setup-miniconda@v4
with:
miniconda-version: latest
auto-update-conda: false
auto-activate-base: false
- name: Install CUDA Toolkit 12.8 packages
shell: pwsh
run: |
$cudaEnv = Join-Path $env:RUNNER_TEMP 'cuda-build'
conda create -y -p $cudaEnv -c nvidia/label/cuda-12.8.1 -c nvidia -c conda-forge cuda-nvcc cuda-cudart-dev cuda-cccl
$cudaRoot = Join-Path $cudaEnv 'Library'
$nvcc = Join-Path $cudaRoot 'bin\nvcc.exe'
if (-not (Test-Path $nvcc)) {
throw "nvcc.exe not found at $nvcc"
}
"CUDA_HOME=$cudaRoot" >> $env:GITHUB_ENV
"CUDA_PATH=$cudaRoot" >> $env:GITHUB_ENV
"CUDACXX=$nvcc" >> $env:GITHUB_ENV
"$cudaRoot\bin" >> $env:GITHUB_PATH
Write-Host "CUDA root: $cudaRoot"
& $nvcc --version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Set up MSVC developer shell
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Verify toolchain
shell: pwsh
run: |
python --version
where.exe cl
cl 2>&1 | Select-Object -First 5
nvcc --version
Write-Host "CUDA_PATH=$env:CUDA_PATH"
- name: Build nvdiffrast wheel
shell: pwsh
run: |
$wheelDir = Join-Path $PWD 'native-wheels\wheelhouse\${{ matrix.python-abi }}'
.\native-wheels\scripts\build-nvdiffrast.ps1 `
-Python 'python' `
-OutDir $wheelDir `
-WorkDir ".\native-wheels\work\nvdiffrast-${{ matrix.python-abi }}" `
-CudaRoot $env:CUDA_PATH `
-Clean
- name: Build diff_gaussian_rasterization wheel
shell: pwsh
run: |
$wheelDir = Join-Path $PWD 'native-wheels\wheelhouse\${{ matrix.python-abi }}'
.\native-wheels\scripts\build-diff-gaussian.ps1 `
-Python 'python' `
-OutDir $wheelDir `
-WorkDir ".\native-wheels\work\diff-gaussian-${{ matrix.python-abi }}" `
-CudaRoot $env:CUDA_PATH `
-Clean
- name: Smoke-test built wheels
shell: pwsh
run: |
$wheelDir = Join-Path $PWD 'native-wheels\wheelhouse\${{ matrix.python-abi }}'
.\native-wheels\scripts\smoke-test.ps1 -Python 'python' -WheelDir $wheelDir
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: native-windows-wheels-${{ matrix.python-abi }}
path: native-wheels/wheelhouse/${{ matrix.python-abi }}/*.whl
if-no-files-found: error
publish:
name: Publish release assets
needs: build
runs-on: ubuntu-latest
if: ${{ inputs.upload_release }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: native-windows-wheels-*
merge-multiple: true
- name: Create or update GitHub Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
set -euo pipefail
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
echo "Release $RELEASE_TAG already exists"
else
gh release create "$RELEASE_TAG" \
--title "Native Windows wheels for TRELLIS text (${RELEASE_TAG})" \
--notes "Prebuilt Windows wheels for nvdiffrast and diff_gaussian_rasterization targeting cp311/cp312, torch 2.7.0, torchvision 0.22.0, and CUDA 12.8. Upstream native components retain their original non-commercial / research-oriented licenses."
fi
- name: Upload wheels and licenses to Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
set -euo pipefail
ls -la dist
gh release upload "$RELEASE_TAG" dist/*.whl native-wheels/licenses/nvdiffrast-LICENSE.txt native-wheels/licenses/diff-gaussian-rasterization-LICENSE.md --clobber