Skip to content

cuda: Add compile test only for CI - #1579

Open
StormBytePP wants to merge 1 commit into
Netflix:masterfrom
StormBytePP:ci_for_cuda
Open

cuda: Add compile test only for CI#1579
StormBytePP wants to merge 1 commit into
Netflix:masterfrom
StormBytePP:ci_for_cuda

Conversation

@StormBytePP

@StormBytePP StormBytePP commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a CUDA compile check to the libvmaf GitHub Actions workflow so that -Denable_cuda=true is exercised on every push/PR.

This implements the request in #1576: a lightweight CI job that installs the CUDA toolkit + nv-codec-headers, configures with Meson, and builds/installs. Runners do not have an NVIDIA GPU, so device tests are not run; the goal is to catch configure/compile regressions early.

Closes #1576

Build directory (out-of-tree, CUDA jobs only)

Only the CUDA matrix entries configure the build in a temporary directory outside the source tree (e.g. $RUNNER_TEMP/libvmaf_build). All other jobs keep the existing in-tree layout (libvmaf/build), so tests, tox, and packaging behave as on master.

Out-of-tree for CUDA is intentional:

  • With the current Meson CUDA rules, several nvcc/clang custom targets use relative include paths such as -I ./src, -I ../src, etc. Those paths work when the build directory is a subdirectory of the source root, but break when the build dir is fully outside the tree.
  • Using an out-of-tree build for the CUDA jobs makes that class of failure visible instead of hiding it behind an in-tree layout.
  • CUDA: Fix compile, SIGSEGV and tests #1573 fixes those relative includes (among other CUDA compile/test issues) by using absolute paths based on meson.current_source_dir() / the build directory, and adjusts related test wiring. Once CUDA: Fix compile, SIGSEGV and tests #1573 is merged, the CUDA CI jobs should stay green for out-of-tree builds as well.

So this workflow both guards CUDA support and documents why out-of-tree builds matter for the CUDA path, without disrupting the rest of the matrix.

What the CUDA jobs do

Two matrix entries on ubuntu-latest (x86_64):

Job Host compiler Device compiler
linux-x86_64-gcc-cuda GCC nvcc (-Denable_nvcc=true)
linux-x86_64-clang-cuda Clang clang (-Denable_nvcc=false)

Both:

  • Enable CUDA with -Denable_cuda=true
  • Install a compile-only CUDA toolkit (no driver/runtime metapackages that pull in nvidia-open and fail on CPU-only runners)
  • Install nv-codec-headers (FFmpeg) so ffnvcodec/dynlink_cuda.h is available
  • Run meson setup + ninja install only (no GPU tests)
  • Use an out-of-tree build directory ($RUNNER_TEMP/libvmaf_build)

Existing non-CUDA jobs are unchanged (in-tree build, tests, tox, packaging).

Notes

  • Covering both nvcc and clang as device compilers matches the two paths exposed by -Denable_nvcc. Toolkit and Clang versions on the runner may need occasional bumps when Ubuntu/NVIDIA package sets change.
  • MinGW/MSYS2 CUDA was not added here: cross-compiling CUDA for Windows from Linux is awkward and not a good fit for this check. Native Windows/MSVC CUDA coverage can follow once MSVC support is merged.
  • CUDA toolkit installation: The workflow currently uses the third-party action Jimver/cuda-toolkit purely for convenience (precise version control + compile-only packages).
    If the maintainers prefer to avoid external actions, this can be trivially replaced with a manual installation via apt (or the official NVIDIA runfile) on Ubuntu. Just let me know and I’ll update it.

Test plan

  • Non-CUDA matrix jobs still configure, build, test, and package as before (in-tree libvmaf/build)
  • GCC + nvcc CUDA job installs toolkit + headers and completes meson setup + ninja install (out-of-tree)
  • Clang + clang-device CUDA job installs toolkit + headers and completes meson setup + ninja install (out-of-tree)
  • After CUDA: Fix compile, SIGSEGV and tests #1573: confirm out-of-tree CUDA builds remain green

Signed-off-by: David C. Manuelda <StormByte@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding a minimal CUDA compile check to CI

1 participant