Skip to content

Commit 5a856f5

Browse files
committed
ci: GPU/OptiX full build and test (#1992)
At long last, turn on full execution and testing for OptiX in our CI, using the GitHub GPU-enabled runners. This should greatly reduce the possibility of build breaks from not actually testing OptiX rendering, not to mention making it possible to make changes on the OptiX code path and have it confirmed by our usual CI. Previously, we were building against the OptiX headers, so at least we wouldn't make an obvious build break, but we weren't executing the testsuite on GPUs. So it was still possible to merge code that broke that code path in practice. For PRs that looked obviously risky, I would pull them to my work machine, build and test with real GPUs to confirm. But this was a big pain, extra trouble for me, and very error prone -- sometimes I didn't recognize that a PR needed that extra testing, or sometimes I forgot entirely, and merged broken code. Note that this depends on PAID GitHub runners with GPUs. The bill is paid by ASWF, but it means those runners are only available on the ASWF GitHub account -- that is, they will run for PRs once submitted, but not when you merely push to your own account's fork, sorry. When running on a non-ASWF account, it will select an ordinary free runner and build OSL against the OptiX headers, but will not run the testsuite since there is no GPU. Signed-off-by: Larry Gritz <[email protected]>
1 parent a4d3a08 commit 5a856f5

File tree

5 files changed

+69
-20
lines changed

5 files changed

+69
-20
lines changed

.github/workflows/build-steps.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ jobs:
8888
runs-on: ${{ inputs.runner }}
8989
container:
9090
image: ${{ inputs.container }}
91-
91+
options: ${{ (contains(inputs.runner, 'gpu') && '-e NVIDIA_DRIVER_CAPABILITIES=compute,graphics,utility --gpus all') || '-e A=x' }}
92+
# ^^ need extra options on the GPU runners to ensure OptiX is visible
93+
# in the container.
9294
env:
9395
CXX: ${{inputs.cxx_compiler}}
9496
CC: ${{inputs.cc_compiler}}

.github/workflows/ci.yml

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ permissions: read-all
4040
jobs:
4141

4242
aswf-old:
43-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') }}
43+
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
4444
name: "VFX${{matrix.vfxyear}} ${{matrix.desc}}"
4545
strategy:
4646
fail-fast: false
@@ -203,7 +203,7 @@ jobs:
203203
204204
205205
linux:
206-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') }}
206+
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
207207
name: "${{matrix.desc}}"
208208
uses: ./.github/workflows/build-steps.yml
209209
with:
@@ -250,20 +250,7 @@ jobs:
250250
pybind11_ver: v2.9.0
251251
simd: avx2,f16c
252252
batched: b8_AVX2
253-
- desc: VP2023 GPU Cuda11 gcc11/C++17 llvm15 py3.10 OIIO-main avx2
254-
nametag: linux-optix7-2023
255-
runner: ubuntu-latest
256-
container: aswftesting/ci-osl:2023-clang15
257-
cxx_std: 17
258-
openimageio_ver: main
259-
python_ver: "3.10"
260-
pybind11_ver: v2.10.0
261-
simd: avx2,f16c
262-
skip_tests: 1
263-
setenvs: export OSL_CMAKE_FLAGS="-DOSL_USE_OPTIX=1"
264-
OPTIX_VERSION=7.0.0
265-
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=9.1.0
266-
- desc: VP2024 gcc11/C++17 llvm17 py3.11 boost1.82 oiio-rel avx2
253+
- desc: VP2024 gcc11/C++17 llvm17 py3.11 oiio-rel avx2
267254
nametag: linux-vfx2024
268255
runner: ubuntu-latest
269256
container: aswftesting/ci-osl:2024-clang17
@@ -486,7 +473,7 @@ jobs:
486473

487474

488475
macos:
489-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'linux-only') }}
476+
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'optix-only') }}
490477
name: "${{matrix.desc}}"
491478
uses: ./.github/workflows/build-steps.yml
492479
with:
@@ -555,7 +542,7 @@ jobs:
555542

556543

557544
windows:
558-
if: ${{ ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'macos-only') }}
545+
if: ${{ ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
559546
name: "${{matrix.desc}}"
560547
uses: ./.github/workflows/build-steps.yml
561548
with:
@@ -620,3 +607,59 @@ jobs:
620607
OSL_CMAKE_FLAGS="-DUSE_LLVM_BTCODE=ON"
621608
PUGIXML_VERSION=v1.14
622609
OpenImageIO_BUILD_MISSING_DEPS="Freetype;TIFF;libdeflate;libjpeg-turbo"
610+
611+
612+
optix-gpu:
613+
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') }}
614+
name: "${{matrix.desc}}"
615+
uses: ./.github/workflows/build-steps.yml
616+
with:
617+
nametag: ${{ matrix.nametag || 'unnamed!' }}
618+
runner: ${{ matrix.runner || 'ubuntu-latest' }}
619+
container: ${{ matrix.container }}
620+
cc_compiler: ${{ matrix.cc_compiler || 'gcc' }}
621+
cxx_compiler: ${{ matrix.cxx_compiler || 'g++' }}
622+
cxx_std: ${{ matrix.cxx_std || '17' }}
623+
build_type: ${{ matrix.build_type || 'Release' }}
624+
depcmds: ${{ matrix.depcmds }}
625+
extra_artifacts: ${{ matrix.extra_artifacts }}
626+
fmt_ver: ${{ matrix.fmt_ver }}
627+
opencolorio_ver: ${{ matrix.opencolorio_ver }}
628+
openexr_ver: ${{ matrix.openexr_ver }}
629+
openimageio_ver: ${{ matrix.openimageio_ver }}
630+
pybind11_ver: ${{ matrix.pybind11_ver }}
631+
python_ver: ${{ matrix.python_ver }}
632+
setenvs: ${{ matrix.setenvs }}
633+
simd: ${{ matrix.simd }}
634+
batched: ${{ matrix.batched }}
635+
skip_build: ${{ matrix.skip_build }}
636+
skip_tests: ${{ matrix.skip_tests }}
637+
abi_check: ${{ matrix.abi_check }}
638+
build_docs: ${{ matrix.build_docs }}
639+
generator: ${{ matrix.generator }}
640+
ctest_args: ${{ matrix.ctest_args }}
641+
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
642+
coverage: ${{ matrix.coverage || 0 }}
643+
sonar: ${{ matrix.sonar || 0 }}
644+
llvm_action_ver: ${{ matrix.llvm_action_ver }}
645+
clang_format: ${{ matrix.clang_format }}
646+
strategy:
647+
fail-fast: false
648+
matrix:
649+
include:
650+
- desc: OptiX ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'GPU') || 'build only' }} VP2025 gcc11/C++17 llvm18 py3.11 oiio-rel avx2
651+
# ^^ This will run on GPU when on the ASWF account, but is a
652+
# "build only" test on user accounts. Similar conditionals below
653+
# select the right runner type and whether tests are run.
654+
nametag: linux-optix-vfx2025
655+
runner: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-gpu-t4-4c-16g-176h') || 'ubuntu-latest' }}
656+
container: aswf/ci-osl:2025-clang18
657+
cxx_std: 17
658+
python_ver: "3.11"
659+
pybind11_ver: v2.11.1
660+
simd: avx2,f16c
661+
skip_tests: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && '0') || '1' }}
662+
setenvs: export OSL_CMAKE_FLAGS="-DOSL_USE_OPTIX=1"
663+
OPTIX_VERSION=8.0.0
664+
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=9.1.0
665+
CTEST_EXCLUSIONS="broken|render-microfacet|example-cuda|python-oslquery"

src/build-scripts/gh-installdeps.bash

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ if [[ "$OPTIX_VERSION" != "" ]] ; then
152152
echo "Requested OPTIX_VERSION = '${OPTIX_VERSION}' from ${OPTIXREPO}"
153153
export OptiX_ROOT=$LOCAL_DEPS_DIR/dist/optix-dev
154154
git clone -b v${OPTIX_VERSION} ${OPTIXREPO} ${OptiX_ROOT}
155+
export PATH=$PATH:/usr/local/cuda-12/bin
156+
export LD_LIBRARY_PATH=/usr/local/cuda-12/lib64:$LD_LIBRARY_PATH
157+
find / -name "*nv*so" -print || true
155158
fi
156159

157160

src/cmake/externalpackages.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ if (OSL_USE_OPTIX)
201201
target_link_libraries (${TARGET} PRIVATE ${CUDA_LIBRARIES} ${CUDA_EXTRA_LIBS} ${OPTIX_LIBRARIES} ${OPTIX_EXTRA_LIBS})
202202
endfunction()
203203
else ()
204+
message(STATUS "CUDA/OptiX support disabled")
204205
function (osl_optix_target TARGET)
205206
endfunction()
206207
endif ()

testsuite/render-mx-generalized-schlick/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
failthresh = 0.01
88
failpercent = 1
9-
allowfailures = 2
9+
allowfailures = 5
1010
idiff_program = "idiff"
1111

1212
outputs = [ "out.exr" ]

0 commit comments

Comments
 (0)