Repository navigation
feat(hip): import GL textures through EGL dma-buf export so the pinned ROCm 10.1 reads them (ADR-2132) - #2360
Merged
Merged
Conversation
14 of 15 tasks
lusoris
added a commit
that referenced
this pull request
Oct 6, 2026
…to the integration branch Conflicts resolved per hunk: core/api/vmafx.toml takes the lane's GL texture text with integration's ABI number (0.1.7); docs/state.md through the resolver; generated files (frame.h, the ADR and research indexes, the API pages, the citation registry) took integration's side and were regenerated. The shared EGL export (core/src/vmafx/egl_export.c, ADR-2132) joins libvmafx_sources. CPU build clean.
lusoris
force-pushed
the
rc4/api-wp3-hip
branch
from
October 8, 2026 17:43
20a3f4d to
228b5af
Compare
16 of 18 tasks
lusoris
force-pushed
the
rc4/api-wp3-hip
branch
2 times, most recently
from
October 9, 2026 10:42
142a898 to
e0f59be
Compare
lusoris
force-pushed
the
rc4/api-wp3-hip-gl-dmabuf
branch
from
October 9, 2026 14:28
657e74a to
9f89793
Compare
lusoris
marked this pull request as ready for review
October 9, 2026 14:29
…d ROCm 10.1 reads them (ADR-2132) (#2360) * feat(hip): import GL textures through EGL dma-buf export so the pinned ROCm 10.1 reads them (ADR-2132) The runtime's GL interop maps a texture but cannot read it on ROCm 10.1, so every GL import on HIP was refused. A GL texture is now exported as a dma-buf through EGL and imported as a DMABUF frame. radeonsi exports its own tiling (measured: 97 percent of samples differ when read as linear rows), so a tiled export is copied on the GPU into a linear GBM dma-buf with VMAFX_IMPORT_ALLOW_COPY, the producer's GL state restored. The context's GPU is checked against the device's. Closes T-HIP-ROCM10-GL-TEXTURE-READ. * docs(hip): move the rebase note to a fragment and leave the rendered files to the landing render (ADR-2197) Under render at landing (ADR-2197) a pull request carries no rendered file: the rebase note of the EGL dma-buf GL import moves to docs/rebase-notes.d/hip-gl-egl-dmabuf.md; the landing render writes CHANGELOG.md, the ADR index and docs/rebase-notes.md. * ci(tidy): measure the translation units of the HIP GL import through EGL dma-bufs in the cpu lane The clang-tidy coverage rule on master requires every tracked translation unit to be read by a lane. The new and touched units of this pull request were measured in the dev container (scripts/dev/tidy-lane.sh --write --only ... cpu, clang-tidy 22.1.8): 0 findings, 0 uncited NOLINT; they join the cpu lane's measured sources. Signed-off-by: Lusoris <lusoris@proton.me>
lusoris
force-pushed
the
rc4/api-wp3-hip-gl-dmabuf
branch
from
October 9, 2026 16:29
9f89793 to
d828570
Compare
This was referenced Oct 9, 2026
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.
Summary
BLUF: HIP now imports OpenGL textures on the pinned ROCm 10.1 by exporting each texture as a dma-buf through EGL (
EGL_MESA_image_dma_buf_export) and importing it as aDMABUFframe, with the GL sync object as the acquire fence. The runtime's GL interop is no longer called. ClosesT-HIP-ROCM10-GL-TEXTURE-READ-2026-10-06for vmafx (OBS on AMD Linux, #2238). Stacked on #2341 (rc4/api-wp3-hip).radeonsi exports the texture in its own tiling (modifier
DRM_FORMAT_MOD_INVALID; read as linear rows 223464 of 230400 samples differ), so a tiled export is copied on the GPU into a linear GBM dma-buf (one blit per plane inside the producer's context, GL state restored) and needsVMAFX_IMPORT_ALLOW_COPY. The context's GPU is checked against the device's. ADR-2132, research digest 2161.Landing (Q-083)
Lands bottom-up after #2341 (WP3 HIP), one API PR at a time. The PR's diff (old base
20a3f4d4d, the #2341 head it was written on, to657e74a53) was squashed into one commit, put on the restacked #2341 on 2026-10-07 and is now rebased onto masterd70f0be5d(#2341 landed ase0f59be2a). ADR-2132 is Accepted.ABI check against master:
python3 scripts/codegen/vmafx-api.py --abi-check --against-ref origin/master->definition is an append-only successor of origin/master (0 additions). This PR changes the documentation ofVMAFX_MEMORY_GL_TEXTUREonly, soabi_versionstays 0.1.8.Conflicts, resolved per hunk when the PR was first put on #2341:
core/api/vmafx.toml: this PR's doc text with the parent's ABI number.docs/state.md: the resolver (T-HIP-ROCM10-GL-TEXTURE-READ-2026-10-06moves to Recently closed and leaves the deferred label row).The rebases since (onto #2290, onto #2341's landing head and onto master after #2341 landed) applied the feature and docs commits unchanged; each time the cpu clang-tidy baseline took master's side and
core/src/vmafx/egl_export.cwas measured again. Changed while landing:docs/research/2161-hip-gl-egl-dmabuf-tiling.md, not 2160: the SYCL lane (feat(api): import SYCL device frames with event fences, dma-bufs and GL textures (RC4 WP3, ADR-2091) #2342), which lands after this PR, holds Research-2160 (2160-vmafx-sycl-device-frames.md). The digest's heading, the link in ADR-2132's References and the closed state row follow.docs/rebase-notes.d/hip-gl-egl-dmabuf.md(ADR-2197); the rendered files are master's.ci(tidy): the cpu lane's baseline recordscore/src/vmafx/egl_export.c.No integration-branch commit is carried.
Local gate (on
9f8979385, masterd70f0be5d)-Db_lto=false,-j4, warnings as errors): build 0 warnings;--suite=fast433 OK, 0 failed (test_gpu_picture_pool_uafon its own withMALLOC_PERTURB_=0: OK); codegen tests 207 passed;make test-netflix-golden GOLDEN_NINJA_JOBS=4280 passed, 3 skipped;preflight.sh --stage msvcismpass; affected suites: tooling 2668 passed, 0 failed, 6 skipped.vmafx-api.py --check: 80 generated files match;--abi-check --against-ref origin/master: 0 additions.vmafx-hip-lane:rocm10.1.0-egl(the pinnedrocm/dev-ubuntu-26.04:10.1.0-full@sha256:4f5ed1bf…, HIP 7.16.26385, with the EGL / GLES / X11 development libraries the GL test needs; ROCm unchanged), Mesa on the host display, gfx1036, every device runflock hip-gfx1036.lock timeout 290. Build (-Denable_hip=true -Denable_hipcc=true -Dhip_gfx_targets=gfx1036,-Dwerror=true, fatal link warnings): 0 warnings.test_vmafx_import_hip_gl5/5: NV12 and P010 GL frames 42 values each, 0 differing from host upload; a tiled export refused withoutVMAFX_IMPORT_ALLOW_COPY; the producer's GL state restored; no current EGL context refused.test_vmafx_import_hip16/16;test_vmafx_import_hip_fence8/8;test_vmafx_fence_kinds5/5;test_hip_shared_frame9/9.test_vmafx_import_hip_bitexact, one run per clip (0 to 3 and the 4K pair): 354 cells, 16098 values, 0 cells differing, 0 attempts repeated, 9042 imports, 6028 conversions, 0 host copies.scripts/dev/tidy-lane.sh --write --only ...), re-measured on this tree: cpucore/src/vmafx/egl_export.c0 findings (again on masterd70f0be5d); hipcore/src/hip/import_frame.c,core/src/hip/import_gl.c,core/src/vmafx/egl_export.c,core/test/test_vmafx_import_hip_gl.c0 findings.docs/state.mdtouch and rows, silent revert against master,praetorctl audit): pass.The earlier evidence on this PR (2026-10-07: the 50
fast+gpuHIP tests and the dropped-dispatch sightings in the bitexact runs) stays recorded underT-HIP-GFX1036-DROPPED-DISPATCHES-2026-10-01.Type
feat— new featureChecklist
make lintequivalent: pre-commit hooks green; tidy: cpucore/src/vmafx/egl_export.c0 findings; hipcore/src/hip/import_frame.c,import_gl.c,core/test/test_vmafx_import_hip_gl.c0 findings (container lanes, ADR-1471).scripts/dev/preflight.sh --stage msvcismpasses./cross-backend-diffneeded (import path only).docs/adr/_index_fragments/2132-hip-gl-textures-through-egl-dmabuf.md, slug in_order.txt.Bug-status hygiene
docs/state.md:T-HIP-ROCM10-GL-TEXTURE-READ-2026-10-06moved to Recently closed.Netflix golden-data gate
core/srcextractor code.Reproducer
Pinned image
vmafx-hip-lane:rocm10.1.0(rocm/dev-ubuntu-26.04:10.1.0-fullpluslibegl1 libegl-mesa0 libegl-dev libgles-dev libx11-dev; ROCm toolchain unchanged), gfx1036 (hostryzen-4090-arc), device lock held:Evidence (ROCm 10.1.0, HIP 7.16.26385, gfx1036, Mesa 26.0.8, Linux 7.2.9)
test_vmafx_import_hip_glALLOW_COPYnaming the flag and imported with it; producer GL state (framebuffer binding, scissor) restored; no EGL context current refused namingdesc.memoryrocprofv3 --memory-copy-traceof the GL session: only host-to-device copies of the test's and the twins' tables (46), no device-to-host copytest_vmafx_import_hip_bitexacttest_vmafx_import_hip,_fencedesc.plane[0].modifier),test_gl_textures_nv12failstest_vmafx_import_hip_contract.pyALLOW_COPY, unwaited writersABI:
--abi-check --against-ref origin/rc4/api-generation-prototype: append-only successor (141 additions; this PR adds no symbol, only the doc ofVMAFX_MEMORY_GL_TEXTURE).Deep-dive deliverables (ADR-0108)
docs/research/2161-hip-gl-egl-dmabuf-tiling.md.## Alternatives considered.AGENTS.mdinvariant note —core/src/hip/AGENTS.d/vmafx-device-frames.md(GL item),docs/development/rebase-sensitive-invariants.md.changelog.d/changed/hip-gl-textures-through-egl-dmabuf.md.docs/rebase-notes.d/hip-gl-egl-dmabuf.md(ADR-2197), "HIP GL textures through EGL dma-bufs".Known follow-ups
core/src/sycl/import_gl.c; fold it ontocore/src/vmafx/egl_export.cwhen the lanes merge (HISS-19).