Repository navigation
Conversation
On an NVIDIA GPU, strom-full now renders HTML on the GPU by default. Chromium hands each frame to cefsrc as a dma-buf, which cefsrc copies into GL memory in the consumer's GstGLContext, so an HTML source reaches the GPU vision mixer and NVENC without a CPU round trip. - gstcefsrc gl-output patch: OnAcceleratedPaint import, readback for system-memory consumers, upload of CPU-painted frames into the same GL memory, fallback to CPU frames on import failure or when no GPU frame arrives within 5 s, frame-handover property (auto/gpu/cpu). - CEF 144 -> 158.0.3; strict-network covers the local and loopback network permissions Chromium 145 split Local Network Access into. - strom-full: Xorg on the NVIDIA X driver the container toolkit mounts, started only when the installed gstcefsrc has gl-output; Xvfb and software otherwise. - HTML Input: GL memory offered before system memory, videoconvert dropped, Render Mode property. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #
Problem
HTML sources render in software. That is CPU-heavy for anything animated, and the BGRA frames then get uploaded again for the GPU mixer: one 8 MB copy per frame, per source. The opt-in GPU mode (
STROM_CEF_GPU=1, ANGLE/Vulkan under Xvfb) still read every frame back through the CPU, so it cost more than software on simple pages. On top of that, the pinned CEF 144 cannot hand frames over on the GPU on Linux/NVIDIA at all (seedocs/UPSTREAM_NOTES.md).Change
gstcefsrc (
docker/gstcefsrc/gl-output.patch, new filegstcefgl.cc)shared_texture_enabled.OnAcceleratedPaint, the dma-buf is imported with EGL and blitted on a worker GL context of cefsrc's own into a GL buffer from a pool. The pool allocates in the consumer's GstGLContext, which is found from the GL pool the consumer proposes in the allocation query. GL elements accept memory only from their own context object; being in the same share group is not enough.video/x-raw(memory:GLMemory),format=BGRAorvideo/x-raw,format=BGRA, whichever the consumer takes, with GL first. GL is offered only when the import works. Bytes are kept in memory order: Chromium's BGRA buffer is imported as AB24, so neither path swizzles.frame-handover=gputurns each of these into a flow error instead;cpunever uses shared textures.cefdemuxaccepts GL memory and routes allocation and context queries to its video pad.CEF 144 → 158.0.3 (the newest stable).
strict-network.patch: Chromium 145 split Local Network Access into local network and loopback. Strict now refuses both, plus the old type.strom-full
xserver-xorg-coreis added to the image.NVIDIA_DRIVER_CAPABILITIES=all, already set).GBM_BACKENDS_PATHpoints at the GBM backend the toolkit mounts. No extra mounts are needed in Docker or on Kubernetes with the toolkit or GPU Operator./usr/local/version.txtlists thegl-outputpatch, so the currently pinned CEF 144 build stays in software.STROM_CEF_GPU=0forces software.STROM_CEF_GPU=1keeps the old Vulkan path as a fallback when Xorg cannot start, now withGST_CEF_SHARED_TEXTURE=0.HTML Input block
videoconvertis dropped: every consumer adapts its own input (checked for each block that takes raw video).auto/gpu/cpu, mapped toframe-handover).gpuon a gstcefsrc without the property fails the block.Rejected alternatives
ozone-platform=headless: Chromium allocates no GPU frames there.glReadPixelsfrom cefsrc's context: ~680 ms per 1080p frame. GStreamer's download path takes ~8 ms.glcolorconvertin some runs.Evidence
All measurements are from one AWS g4dn.xlarge (Tesla T4, driver 580.178.04, EKS AL2023 NVIDIA AMI), with strom-full:0.8.2 plus this branch's binary, CEF build and entrypoint.
Correctness
nvh264enc) → WHEP Output, for both PGM and multiview at 1080p.memory:GLMemoryon every video edge fromcefsrctonvh264enc.Fallback and Render Mode
GST_CEF_GL_TEST_BREAK_IMPORT=60: the browser is reopened, about 30 frames/s are uploaded afterwards, and the caps are unchanged.frame-handover=gpuposts an element error in both cases.cpugives system memory.Audio and leaks
cefdemuxwith GL video: −13.5 dBFS RMS for a 0.3 sine.CPU (% of one core: Strom + Chromium, HTML → GPU mixer)
STROM_CEF_GPU=0)For comparison, docs list the wind map at ~95 % in software at 1080p30 on another machine. In a YouTube page, the remaining heavy part is Chromium decoding AV1 in software (no VA-API on NVIDIA). That is unchanged and already in the docs.
Tests
cargo test --lib(1335 passed),cargo clippy --all-targets(clean),cargo fmt --check.output_caps_offer_gl_memory_before_system_memoryandrender_mode_is_auto_unless_gpu_or_cpu.Lesson
docs/BLOCK_GUIDELINES.mdhas a new rule: GL memory a block produces belongs to the consumer's GstGLContext, not just one in its share group. It failed in some runs only. No CI guard is possible (no GPU in CI), so the rule says to check by hand on a GPU host, in more than one run.docs/UPSTREAM_NOTES.mdhas four entries:glReadPixelsin cefsrc's context;For the reviewer
/usr/local/nvidiawithout the X driver stay in software, and the entrypoint logs why.GST_CEF_GL_TEST_BREAK_IMPORT=Nmakes import N fail, for testing the fallback.Remaining before merge
build-gstcefsrcwith CEF158.0.3+g8c29be2+chromium-158.0.8127.18and a new suffix (e.g.strom1).GSTCEFSRC_VERSIONand both sha256 pins indocker/strom-full/Dockerfile.HTML renders on the GPU. Also check the arm64 build of the patch, which has not been compiled yet.Out of scope
🤖 Generated with Claude Code