Windows + Intel Arc backend: the umem amdgpu coupling, and the 64-lane mesh requirement that blocks Arc #1

Closed
opened 2026-11-30 11:17:47 +00:00 by github-bot · 2 comments
Owner

@⁠borosf on GitHub · 2026-11-30 11:17 UTC · original

Scoping a Windows + Intel Arc backend by reading greenfield/umem and greenfield/vkback. Two findings are porting work; the third looks like a scope decision rather than a task, so I'd rather ask before writing anything.

1. umem is welded to amdgpu buffer objects, not to Linux in general

greenfield/umem/src/lib.rs:1-6: every piece of title memory is an amdgpu buffer object exported as dma-buf, mapped at the title's fixed address with mmap(MAP_FIXED|MAP_SHARED), and the Kind set is AMD's memory classes (Vram "through resizable BAR: CPU writes fast, reads very slow", GttCached, write-combined GTT spill).

  • The Windows mirror exists: VK_KHR_external_memory_win32 with an NT handle from a D3D12 heap, MapViewOfFileEx at a fixed base, VirtualProtect/PAGE_GUARD plus a VEH for gating. That is a real port of lib.rs (1,283 lines), mapping.rs (572) and binds.rs (620), not a shim.
  • Arc is a different problem: no amdgpu BO, no ReBAR write-combined VRAM window and no cached GTT, so the Kind policy that makes this fast has to be re-derived against Xe's heaps and residency. That is a second memory design, not a backend flag.

2. pipejob requires 64 lanes for mesh and task stages, and Arc tops out at 32

greenfield/vkback/src/pipejob.rs:76-78 — "Mesh and task stages keep 64 lanes: RADV compiles mesh shaders as wave64 anyway", with the stage requirement resolved from the shader's [WaveSize] just below. The tree has 269 wave64 references to 37 subgroup.

An Arc B580 reports subgroupSize 32 and VK_EXT_subgroup_size_control can only lower it, so every stage that needs 64 lanes is unavailable — and mesh pipelines are 6 sites plus whatever the title's own stages declare. My read is that this is a translator project with a per-cross-lane cost, not a porting step, which is why I stopped before touching cfg.

3. What is portable: presentation (present/xcb.rs, 314 lines of run-time-loaded libxcb → VK_KHR_win32_surface), the rest of the Vulkan recorder, and the RDNA → DXIL → SPIR-V path. The Wine glue is already an explicit seam in greenfield/wine/*.

If this is wanted, the only piece I'd call a normal pull request is step 0: a cfg split so cargo check --target x86_64-pc-windows-msvc yields a finite error list from the umem/vkback seams, with no behaviour change on the Linux path.

The question that decides whether any of it is in scope: is the 64-lane requirement in pipejob a console behaviour you intend to reproduce exactly, or a RADV convenience that can be relaxed to 32 on adapters that only offer 32? The first answer puts Arc out of scope until the translator can emulate 64-lane subgroups; the second makes the Win32 surface and one memory class worth starting.

I have the full seam inventory (file:line, per-mechanism Windows counterpart, and the three-line stage plan) written up; happy to open it as a docs pull request if you want it in the tree, or leave it here if you'd rather keep docs to proven behaviour.

**@⁠borosf** on GitHub · 2026-11-30 11:17 UTC · [original](https://github.com/vktory6/VKtory/issues/1) Scoping a Windows + Intel Arc backend by reading `greenfield/umem` and `greenfield/vkback`. Two findings are porting work; the third looks like a scope decision rather than a task, so I'd rather ask before writing anything. **1. `umem` is welded to amdgpu buffer objects, not to Linux in general** `greenfield/umem/src/lib.rs:1-6`: every piece of title memory is an amdgpu buffer object exported as dma-buf, mapped at the title's fixed address with `mmap(MAP_FIXED|MAP_SHARED)`, and the `Kind` set is AMD's memory classes (`Vram` "through resizable BAR: CPU writes fast, reads very slow", `GttCached`, write-combined GTT spill). - The Windows mirror exists: `VK_KHR_external_memory_win32` with an NT handle from a D3D12 heap, `MapViewOfFileEx` at a fixed base, `VirtualProtect`/`PAGE_GUARD` plus a VEH for gating. That is a real port of `lib.rs` (1,283 lines), `mapping.rs` (572) and `binds.rs` (620), not a shim. - Arc is a different problem: no amdgpu BO, no ReBAR write-combined VRAM window and no cached GTT, so the `Kind` policy that makes this fast has to be re-derived against Xe's heaps and residency. That is a second memory design, not a backend flag. **2. `pipejob` requires 64 lanes for mesh and task stages, and Arc tops out at 32** `greenfield/vkback/src/pipejob.rs:76-78` — "Mesh and task stages keep 64 lanes: RADV compiles mesh shaders as wave64 anyway", with the stage requirement resolved from the shader's `[WaveSize]` just below. The tree has 269 `wave64` references to 37 `subgroup`. An Arc B580 reports `subgroupSize` 32 and `VK_EXT_subgroup_size_control` can only lower it, so every stage that needs 64 lanes is unavailable — and mesh pipelines are 6 sites plus whatever the title's own stages declare. My read is that this is a translator project with a per-cross-lane cost, not a porting step, which is why I stopped before touching `cfg`. **3. What is portable:** presentation (`present/xcb.rs`, 314 lines of run-time-loaded libxcb → `VK_KHR_win32_surface`), the rest of the Vulkan recorder, and the RDNA → DXIL → SPIR-V path. The Wine glue is already an explicit seam in `greenfield/wine/*`. If this is wanted, the only piece I'd call a normal pull request is step 0: a `cfg` split so `cargo check --target x86_64-pc-windows-msvc` yields a finite error list from the umem/vkback seams, with no behaviour change on the Linux path. The question that decides whether any of it is in scope: is the 64-lane requirement in `pipejob` a console behaviour you intend to reproduce exactly, or a RADV convenience that can be relaxed to 32 on adapters that only offer 32? The first answer puts Arc out of scope until the translator can emulate 64-lane subgroups; the second makes the Win32 surface and one memory class worth starting. I have the full seam inventory (file:line, per-mechanism Windows counterpart, and the three-line stage plan) written up; happy to open it as a docs pull request if you want it in the tree, or leave it here if you'd rather keep docs to proven behaviour.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 11:17:47 +00:00
Author
Owner

@⁠borosf on GitHub · 2026-11-30 19:24 UTC · original

Closing too, since no upstream PRs from our side. The seam inventory is kept in our own tree; the 64-lane question will answer itself once we have a Windows build to measure.

**@⁠borosf** on GitHub · 2026-11-30 19:24 UTC · [original](https://github.com/vktory6/VKtory/issues/1#issuecomment-7289348797) Closing too, since no upstream PRs from our side. The seam inventory is kept in our own tree; the 64-lane question will answer itself once we have a Windows build to measure.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 19:38 UTC · original

Related discussion: https://github.com/vktory6/VKtory/discussions/270 ("Where should the shader translator go next?") is where the translator's direction is being discussed, including the parts this issue touches.

**@⁠vktory6** on GitHub · 2026-12-02 19:38 UTC · [original](https://github.com/vktory6/VKtory/issues/1#issuecomment-7356486138) Related discussion: https://github.com/vktory6/VKtory/discussions/270 ("Where should the shader translator go next?") is where the translator's direction is being discussed, including the parts this issue touches.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#1
No description provided.