feat(docker): enable HW-codec features in Dockerfile.full-gpu#321
Conversation
Add nvcodec, vulkan_video, and vaapi Cargo features to the full-gpu Docker image so that HW-accelerated video codec nodes (NVENC AV1, Vulkan Video H.264, VA-API AV1/H.264) are available at runtime. Changes: - Add Stage 0 to extract CUDA dev headers from nvidia/cuda devel image (shiguredo_nvcodec needs cuda.h for bindgen FFI generation) - Install libva-dev + libgbm-dev in build stages (cros-codecs vaapi) - Set CUDA_INCLUDE_PATH in both cargo build commands - Extend --features to include nvcodec,vulkan_video,vaapi - Add VA-API runtime libs (libva2, libva-drm2, libgbm1, mesa-va-drivers) to the runtime stage Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| RUSTFLAGS="-C link-arg=-fuse-ld=bfd" \ | ||
| cargo build --profile release-lto -p streamkit-server --bin skit --features "moq,svt_av1_static,dav1d_static" -j$(nproc) && \ | ||
| CUDA_INCLUDE_PATH=/usr/local/cuda/include \ | ||
| cargo build --profile release-lto -p streamkit-server --bin skit --features "moq,svt_av1_static,dav1d_static,nvcodec,vulkan_video,vaapi" -j$(nproc) && \ |
There was a problem hiding this comment.
🚩 No Vulkan SDK dev package installed for vulkan_video build
The vulkan_video feature depends on the vk-video crate, but neither Stage 1 nor Stage 3 installs libvulkan-dev (the Vulkan development package). This is likely fine because Rust Vulkan crates (typically built on ash) use runtime dynamic loading (dlopen) for libvulkan.so.1 rather than link-time linking against libvulkan.so. However, if vk-video ever changes to use link-time binding, the build would fail. The runtime stage correctly installs libvulkan1 at Dockerfile.full-gpu:695.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
Correct — vk-video uses ash which does runtime dlopen("libvulkan.so.1"), so no link-time dependency on libvulkan-dev. The CI E2E workflow (e2e.yml) also builds with vulkan_video without installing libvulkan-dev and it works fine. The runtime stage already has libvulkan1 at line 695.
Summary
Enables
nvcodec,vulkan_video, andvaapiCargo features in thefull-gpuDocker image so that HW-accelerated video codec nodes (NVENC AV1, Vulkan Video H.264, VA-API AV1/H.264) are compiled into the shipped binary.Previously, none of the five Dockerfiles included these features, leaving a gap where sample pipelines like
nv_av1_colorbars,vulkan_video_h264_colorbars, andvaapi_*_colorbarscould not run in any Docker image.Changes:
nvidia/cudadevel image —shiguredo_nvcodecuses bindgen and needscuda.h.libva-dev+libgbm-dev(required bycros-codecsfor thevaapifeature), copy CUDA headers, setCUDA_INCLUDE_PATH, and extend--featuresto includenvcodec,vulkan_video,vaapi.libva2,libva-drm2,libgbm1,mesa-va-driversfor VA-API runtime support.libvulkan1was already present;nvidia-container-toolkitinjects NVIDIA driver libs at runtime.Review & Testing Checklist for Human
docker build -f Dockerfile.full-gpu -t streamkit:full-gpu .should complete without errors. The new cuda-dev stage adds a COPY layer but the devel image is already pulled for whisper-builder, so no extra pull overhead.shiguredo_nvcodecbindgen succeeds with the CUDA headers copied from the devel image (theCUDA_INCLUDE_PATHmust point to the correct location).nv_av1_colorbars,vulkan_video_h264_colorbars, and/orvaapi_*_colorbarssample pipelines inside the container.libva2,libva-drm2,libgbm1, andmesa-va-driversresolve correctly on thenvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04base.Notes
vulkan_videofeature (viavk-video/ash) does not needlibvulkan-devat build time — it generates its own Vulkan bindings. Onlylibvulkan1is needed at runtime (already present).--features "gpu nvcodec vulkan_video svt_av1 dav1d_static"on the self-hosted runner, so these code paths are tested — they were just missing from the shipped Docker image.mesa-va-driverscovers Intel iGPU and AMD. Intel discrete (Arc) users may needintel-media-va-driver-non-freefrom Intel repos. NVIDIA VA-API decode uses the communitynvidia-vaapi-driver(not bundled).Link to Devin session: https://staging.itsdev.in/sessions/2642e0c7e33d4e9d89101b2659f7002a
Requested by: @streamer45