Skip to content

Commit 5b3fa75

Browse files
committed
ci: GPU/OptiX full build and test
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 <lg@larrygritz.com>
1 parent f1f8078 commit 5b3fa75

5 files changed

Lines changed: 71 additions & 7 deletions

File tree

.github/workflows/build-steps.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ on:
1818
type: string
1919
container:
2020
type: string
21+
container_options:
22+
type: string
2123
cc_compiler:
2224
type: string
2325
cxx_compiler:
@@ -88,7 +90,7 @@ jobs:
8890
runs-on: ${{ inputs.runner }}
8991
container:
9092
image: ${{ inputs.container }}
91-
93+
options: ${{ inputs.container_options }}
9294
env:
9395
CXX: ${{inputs.cxx_compiler}}
9496
CC: ${{inputs.cc_compiler}}

.github/workflows/ci.yml

Lines changed: 63 additions & 5 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,13 +203,14 @@ 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:
210210
nametag: ${{ matrix.nametag || 'unnamed!' }}
211211
runner: ${{ matrix.runner || 'ubuntu-latest' }}
212212
container: ${{ matrix.container }}
213+
container_options: ${{ matrix.container_options || '-e A=x' }}
213214
cc_compiler: ${{ matrix.cc_compiler || 'gcc' }}
214215
cxx_compiler: ${{ matrix.cxx_compiler || 'g++' }}
215216
cxx_std: ${{ matrix.cxx_std || '17' }}
@@ -263,7 +264,7 @@ jobs:
263264
setenvs: export OSL_CMAKE_FLAGS="-DOSL_USE_OPTIX=1"
264265
OPTIX_VERSION=7.0.0
265266
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=9.1.0
266-
- desc: VP2024 gcc11/C++17 llvm17 py3.11 boost1.82 oiio-rel avx2
267+
- desc: VP2024 gcc11/C++17 llvm17 py3.11 oiio-rel avx2
267268
nametag: linux-vfx2024
268269
runner: ubuntu-latest
269270
container: aswftesting/ci-osl:2024-clang17
@@ -486,13 +487,14 @@ jobs:
486487

487488

488489
macos:
489-
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'linux-only') }}
490+
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'optix-only') }}
490491
name: "${{matrix.desc}}"
491492
uses: ./.github/workflows/build-steps.yml
492493
with:
493494
nametag: ${{ matrix.nametag || 'unnamed!' }}
494495
runner: ${{ matrix.runner }}
495496
container: ${{ matrix.container }}
497+
container_options: ${{ matrix.container_options || '-e A=x' }}
496498
cc_compiler: ${{ matrix.cc_compiler || 'clang' }}
497499
cxx_compiler: ${{ matrix.cxx_compiler || 'clang++' }}
498500
cxx_std: ${{ matrix.cxx_std || '17' }}
@@ -555,13 +557,14 @@ jobs:
555557

556558

557559
windows:
558-
if: ${{ ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'macos-only') }}
560+
if: ${{ ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
559561
name: "${{matrix.desc}}"
560562
uses: ./.github/workflows/build-steps.yml
561563
with:
562564
nametag: ${{ matrix.nametag || 'unnamed!' }}
563565
runner: ${{ matrix.runner }}
564566
container: ${{ matrix.container }}
567+
container_options: ${{ matrix.container_options || '-e A=x' }}
565568
cc_compiler: ${{ matrix.cc_compiler }}
566569
cxx_compiler: ${{ matrix.cxx_compiler }}
567570
cxx_std: ${{ matrix.cxx_std || '17' }}
@@ -634,3 +637,58 @@ jobs:
634637
OSL_CMAKE_FLAGS="-DUSE_LLVM_BTCODE=ON"
635638
PUGIXML_VERSION=v1.14
636639
OpenImageIO_BUILD_MISSING_DEPS="Freetype;TIFF;libdeflate;libjpeg-turbo"
640+
641+
642+
optix-gpu:
643+
if: ${{ ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') }}
644+
name: "${{matrix.desc}}"
645+
uses: ./.github/workflows/build-steps.yml
646+
with:
647+
nametag: ${{ matrix.nametag || 'unnamed!' }}
648+
runner: ${{ matrix.runner || 'ubuntu-latest' }}
649+
container: ${{ matrix.container }}
650+
container_options: ${{ matrix.container_options || '-e A=x' }}
651+
cc_compiler: ${{ matrix.cc_compiler || 'gcc' }}
652+
cxx_compiler: ${{ matrix.cxx_compiler || 'g++' }}
653+
cxx_std: ${{ matrix.cxx_std || '17' }}
654+
build_type: ${{ matrix.build_type || 'Release' }}
655+
depcmds: ${{ matrix.depcmds }}
656+
extra_artifacts: ${{ matrix.extra_artifacts }}
657+
fmt_ver: ${{ matrix.fmt_ver }}
658+
opencolorio_ver: ${{ matrix.opencolorio_ver }}
659+
openexr_ver: ${{ matrix.openexr_ver }}
660+
openimageio_ver: ${{ matrix.openimageio_ver }}
661+
pybind11_ver: ${{ matrix.pybind11_ver }}
662+
python_ver: ${{ matrix.python_ver }}
663+
setenvs: ${{ matrix.setenvs }}
664+
simd: ${{ matrix.simd }}
665+
batched: ${{ matrix.batched }}
666+
skip_build: ${{ matrix.skip_build }}
667+
skip_tests: ${{ matrix.skip_tests }}
668+
abi_check: ${{ matrix.abi_check }}
669+
build_docs: ${{ matrix.build_docs }}
670+
generator: ${{ matrix.generator }}
671+
ctest_args: ${{ matrix.ctest_args }}
672+
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
673+
coverage: ${{ matrix.coverage || 0 }}
674+
sonar: ${{ matrix.sonar || 0 }}
675+
llvm_action_ver: ${{ matrix.llvm_action_ver }}
676+
clang_format: ${{ matrix.clang_format }}
677+
strategy:
678+
fail-fast: false
679+
matrix:
680+
include:
681+
- desc: OptiX VP2025 gcc11/C++17 llvm19 py3.11 oiio-rel avx2
682+
nametag: linux-optix-vfx2025
683+
runner: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-gpu-t4-4c-16g-176h') || 'ubuntu-latest' }}
684+
container: aswf/ci-osl:2025-clang18
685+
container_options: -e NVIDIA_DRIVER_CAPABILITIES=compute,graphics,utility --gpus all
686+
cxx_std: 17
687+
python_ver: "3.11"
688+
pybind11_ver: v2.11.1
689+
simd: avx2,f16c
690+
skip_tests: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && '0') || '1' }}
691+
setenvs: export OSL_CMAKE_FLAGS="-DOSL_USE_OPTIX=1"
692+
OPTIX_VERSION=8.0.0
693+
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=9.1.0
694+
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)