TheRealMJP / MemPoolTest

Performance and bandwidth tester for D3D12 memory pools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MemPoolTest

This is a simple DX12 app that measures how quickly data can be read from various buffer configurations using a simple synthetic compute job. It was made as a companion to my blog post GPU Memory Pools in D3D12, primarily to generate some real-world performance numbers to demonstrate the difference between using L0 and L1 memory pools in D3D12 (AKA UPLOAD and DEFAULT). The app can also measure the time spent on the CPU for updating the buffer contents, since the choice between L0 and L1 is mostly only relevent for data that needs to be frequently updated by the CPU.

The data for the blog post was generated by using a simple benchmarking feature in the app itself. The benchmark can be configured by changing the code in MemPoolTest::InitBenchmark(), which determines which settings will be varied over the course of the benchmark until all combinations have been tested. Once the benchmark is complete, the results are writting to a .csv file.

The app uses the latest (as of 1/4/2024) DirectX Preview Agility SDK to enable support for GPU Upload Heaps. If running on a system with ReBAR supported and enabled, the D3D12_HEAP_TYPE_GPU_UPLOAD heap type will be available in the app which allows directly writing to VRAM from the CPU. This preview SDK requires Developer Mode to be enabled, as does usage of SetStablePowerState to ensure consistent clock speeds for benchmarking.

Building

Open MemPoolTest.sln in Visual Studio 2022 and build the solution. All external dependencies are included in the repo.

About

Performance and bandwidth tester for D3D12 memory pools

License:MIT License


Languages

Language:C++ 72.1%Language:C 22.6%Language:HLSL 3.8%Language:C# 1.5%