GPU memory, Vulkan and RADV: how D3D12 runs on Linux

9 steps · about 2 h 48 min · Intermediate

  1. Proton (software) (article, Wikipedia, 10 min)

    Start with the big picture of how Windows games run on Linux using Wine, DXVK and VKD3D-Proton.

  2. What is Resizable BAR? (article, Corsair, 8 min)

    Learn how the CPU sees GPU memory through a PCIe window, the base idea behind mapping memory directly.

  3. Maximizing Unified Memory Performance in CUDA (article, NVIDIA Developer Blog, 15 min)

    Next, see how unified memory lets the GPU reach system memory and migrate pages, and what copy-free access costs.

  4. Using Vulkan Device Memory (guide, AMD GPUOpen, 15 min)

    Maps those hardware ideas onto Vulkan's memory heaps and types, such as DEVICE_LOCAL and HOST_VISIBLE.

  5. Memory Allocation :: Vulkan Documentation Project (reference, Khronos Vulkan Documentation, 25 min)

    Read the official rules for allocating, mapping and freeing device memory once the vocabulary is familiar.

  6. Advanced Memory Management: Breaking the Memory Wall (tutorial, Khronos Vulkan Documentation, 20 min)

    See aliasing, pooling and zero-copy on unified memory as working Vulkan patterns.

  7. RADV (doc, Mesa 3D documentation, 20 min)

    Learn what the AMD Vulkan driver does in userspace, how it talks to the kernel, and how SPIR-V becomes GPU code.

  8. Placed views keep the title's leftover padding bytes: every view a new shape, long-session leak and slowdown (article, GitHub issue, lobomfz/VIctory-xmem, 15 min)

    A real bug report showing how stale padding bytes in GPU descriptors can cause leaks and slowdowns.

  9. lobomfz/VIctory-xmem (repo, GitHub, 40 min)

    Finish by browsing a Rust project that uses a patched RADV to map memory directly, and apply the earlier concepts to real code.