Skip to content

gfxinfo: Track heap properties at bits rather than lists of numbers.

Charlie Turner requested to merge cturner/gfxinfo-heap-props into master

On my Intel laptop, the heaps are reported of size 0, despite vulkaninfo reporting a memory heap of size 46.92 GiB.

I've changed the memory type checking to use bitmask rather than lists of ints, since the "int" being added as a type on my Intel machine was the OR of,

MEMORY_PROPERTY_DEVICE_LOCAL_BIT
MEMORY_PROPERTY_HOST_VISIBLE_BIT
MEMORY_PROPERTY_HOST_COHERENT_BIT
MEMORY_PROPERTY_HOST_CACHED_BIT

Which equalled 15. Then, "has_type" was seeing if the int 1 (VulkanHeap.DEVICE_LOCAL_BIT) was in the list of known types. Instead, track the bitsets as they come from the Vulkan API, so that in addition to discrete GPUs with distinct heaps where the above scheme works, the info script also reports correct the heaps on integrated GPUs, and more accurately exposes type checks for what the API reports.

I tested this on my Intel iGPU laptop (CoffeeLake-H GT2, UHD Graphics 630),

$ python gfxinfo_vulkan.py The device (32902, 16027) (VRAM=46.92 GiB, GTT=46.92 GiB) implements 101 extensions

(This used to report zero GiB for both, see above)

And on an RX 6700XT,

$ python3 gfxinfo_vulkan.py WARNING: radv is not a conformant vulkan implementation, testing use only. The device (4098, 29663) (VRAM=11.73 GiB, GTT=31.37 GiB) implements 107 extensions

I'm not sure how helpful the memory reports are here, of course in the first case that's my main system's virtual memory, I assume. You might be excused for thinking it's a more powerful GPU, which it certainly is not :)

Merge request reports

Loading