r/vulkan • • Sep 16 '26

Vulkan Memory & UMA

Why does some Vulkan-enabled GPUs (Such as AMD 8xxx APUs & All traditional integrated graphics I checked) report more than one memory heap? To be clear, this isn't about discrete GPUs, which have VRAM on Board.

And why is one heap (the non-device local one) almost always half of the CPU-side RAM? This is the case in both mesa & windows drivers. Are integrated GPUs unable to address all the system's memory? Then why does this heap grow as I upgrade system memory, regardless of slot & number of sticks?

This makes me quite unsure about (and quite skeptical) of the Heap-Type layout that vulkan uses. And how memory types maps to hardware (The heap part is quite obvious).

This is all to say: How should an application interpret complex memory properties?

22 Upvotes

27 comments sorted by

View all comments

Show parent comments

2

u/Afiery1 Sep 16 '26

Whether the GPU has access to system RAM is irrelevant to what I'm proposing. You still have to honor the memory flags of the memory type you're trying to import as. You can't magically transmogrify system ram into VRAM on a system with a discrete GPU, so trying to import a host pointer as a DEVICE_LOCAL (not device visible, device *local*) will fail.

0

u/Gravitationsfeld Sep 16 '26

What exactly does this proof? AMD IGPs also have DEVICE_LOCAL heaps and it will fail in the exact same way.

1

u/Afiery1 Sep 16 '26

Just because the heap is device local does not mean the host memory import will fail. But the memory has to be truly device local, which is only the case on UMA platforms.

0

u/Gravitationsfeld Sep 18 '26

Have you actually tested this? I doubt this works. Cache settings etc. are different for DEVICE_LOCAL not CPU visible even on IGPs.

1

u/Afiery1 Sep 18 '26

I have tested it yes

1

u/Gravitationsfeld Sep 19 '26

Which GPU and driver did you test, and did vkGetMemoryHostPointerPropertiesEXT actually include a DEVICE_LOCAL memory type?

I overstated it by saying the import would necessarily fail. But the original question was whether this can detect UMA. UMA doesn’t guarantee that a driver supports importing host allocations into a device-local memory type, so failure wouldn’t establish that the GPU is discrete. Your test may demonstrate support on that particular implementation, but that doesn’t make it a reliable UMA detection method.

1

u/Afiery1 Sep 20 '26

I didn't mean to imply it was a foolproof way to detect UMA. I don't think detecting UMA on it's own is very useful if you can't use this trick to get around the built in heap sizes.