Hacker News new | past | comments | ask | show | jobs | submit login

While the readme does state this (could be) a joke, this unfortunately isn't possible with PCI-e today:

Motherboards only support directly accessing a (up to) 256 MB segment of VRAM directly from the CPU. This is the BAR1 space/aperture space.

So attempts to create allocations larger than that that are resident in VRAM but also accessible from the CPU will land in system memory, in order to ensure they are accessible from the CPU. Graphics drivers will either have the GPU read the data from system memory, or will do hidden copies to the GPU when they detect the resource is bound, etc.

The author sort of suspects this could be happening:

"There is no guarantee that the persistently mapped buffer technique actually references video memory. The worst case it's shadow memory and this actually wastes memory."




Why do motherboards have this limitation? There's nothing inherent in PCIe that restricts devices to such a small range.

Is this a 32-bit BAR / low 4GB space issue?


I'm not sure, BARs can be 64 bit and there is 6 of them.


This sounds like a little bit of confusion. Its the PCIe aperture your referring to, and its size/location is dependent on the machine/bios in use as much as the requested BAR sizes. A lot of recent xeon and workstation level machines actually again support 64-bit PCI aperture windows. See the discussion about which machines are compatible with the xeon phi which requires 8GB (or more) of MMIO space.

https://www.pugetsystems.com/labs/articles/Will-your-motherb...

Bottom line, most desktop machines only use a legacy 32-bit PCIe window below 4GB. That is why its limited to a fairly small amount of address space (256-1G generally). The ugly problem is that without purchasing a product its generally quite difficult to determine if it supports a 64-bit aperture correctly. Take the Asus x99A board I have, no mention of support one way or the other, but with an i7 (not just a xeon) it actually works with the xeon phi.

(BTW: Nvidia did a better job with this, their tesla cards have a GPU compatibility mode where they restrict the BAR to 256MB for machines that don't support 8GB BARs).


you could still use vram for paging




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: