Skip to content

feat(docker): enable HW-codec features in Dockerfile.full-gpu#321

Merged
streamer45 merged 1 commit into
mainfrom
devin/1776441249-dockerfile-hw-codecs
Apr 18, 2026
Merged

feat(docker): enable HW-codec features in Dockerfile.full-gpu#321
streamer45 merged 1 commit into
mainfrom
devin/1776441249-dockerfile-hw-codecs

Conversation

@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor

@staging-devin-ai-integration staging-devin-ai-integration Bot commented Apr 17, 2026

Summary

Enables nvcodec, vulkan_video, and vaapi Cargo features in the full-gpu Docker 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, and vaapi_*_colorbars could not run in any Docker image.

Changes:

  • Stage 0 (new): Extract CUDA dev headers from nvidia/cuda devel image — shiguredo_nvcodec uses bindgen and needs cuda.h.
  • Build stages 1 & 3: Add libva-dev + libgbm-dev (required by cros-codecs for the vaapi feature), copy CUDA headers, set CUDA_INCLUDE_PATH, and extend --features to include nvcodec,vulkan_video,vaapi.
  • Runtime stage: Add libva2, libva-drm2, libgbm1, mesa-va-drivers for VA-API runtime support. libvulkan1 was already present; nvidia-container-toolkit injects NVIDIA driver libs at runtime.

Review & Testing Checklist for Human

  • Build the imagedocker 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.
  • Verify nvcodec build — confirm shiguredo_nvcodec bindgen succeeds with the CUDA headers copied from the devel image (the CUDA_INCLUDE_PATH must point to the correct location).
  • Test HW-codec pipelines — on a machine with appropriate GPU(s), run the nv_av1_colorbars, vulkan_video_h264_colorbars, and/or vaapi_*_colorbars sample pipelines inside the container.
  • Runtime deps on Ubuntu 22.04 — verify that libva2, libva-drm2, libgbm1, and mesa-va-drivers resolve correctly on the nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04 base.
  • Image size delta — check that the added runtime packages don't inflate the image significantly (mesa-va-drivers pulls in some Mesa libs).

Notes

  • The vulkan_video feature (via vk-video/ash) does not need libvulkan-dev at build time — it generates its own Vulkan bindings. Only libvulkan1 is needed at runtime (already present).
  • The E2E CI workflow already builds with --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.
  • VA-API drivers are vendor-specific: mesa-va-drivers covers Intel iGPU and AMD. Intel discrete (Arc) users may need intel-media-va-driver-non-free from Intel repos. NVIDIA VA-API decode uses the community nvidia-vaapi-driver (not bundled).

Link to Devin session: https://staging.itsdev.in/sessions/2642e0c7e33d4e9d89101b2659f7002a
Requested by: @streamer45


Staging: Open in Devin

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>
@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Staging: Open in Devin
Debug

Playground

Comment thread Dockerfile.full-gpu
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) && \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Staging: Open in Devin

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@streamer45 streamer45 merged commit d23e1a6 into main Apr 18, 2026
8 checks passed
@streamer45 streamer45 deleted the devin/1776441249-dockerfile-hw-codecs branch April 18, 2026 07:39
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.

2 participants