What happens when a GPU reads memory
85 points by ibobev 7 hours ago | 15 comments
yipinwong 5 hours ago
This is a type of article that is HN worthy and came to HN for initially because I don't even understand a third of content there. Giving me inspiration to dive deeper.
replySEriously, I don't understand it (yet) lol.
nazgulsenpai 4 hours ago
That's the best feeling -- idly clicking through looking for that one rabbit hole to fall down then stumbling upon a gem like this. I noticed this the first time on copetti.org articles about game console architectures: know nothing, look every jargon or acronym up as you read along, end up with 42 tabs and a basic high-level understanding of the topic by the end.
replyempiricus 6 hours ago
For a long time, the chip manufacturers had an inclination to simplify the hardware and rely on the software adapting and optimizing. But for decades this bid failed. Now we have the unrelenting AI capable of finetuning kernels relatively quickly. Maybe simpler hw will work this time? Note: not sure if TPU/NPU is not only simple but also too limited.
replyKellyCriterion 5 hours ago
VERY good article, reminds me on:
reply"what every programmer should know about memory" https://github.com/Ty-Chen/Reading-List/blob/master/What%20e...
WalterGR 3 hours ago
That’s somebody’s highlighted copy of the PDF.
replyHere’s a clean version: https://people.freebsd.org/~lstewart/articles/cpumemory.pdf
snigacookie 5 hours ago
Can someone help me understand why I spent 5 minutes reading something that I still don't understand?
replyLink for the ELI5 version?
brcmthrowaway 5 hours ago
Ctrl+F PCIe BAR.. nothing.
replyporridgeraisin 5 hours ago
This is talking about HBM/GDDR
replybrcmthrowaway 5 hours ago
Something needs to be transferred from sysmem right?
replywmf 4 hours ago
That's probably PCIe DMA initiated by the GPU so I don't think BAR is used.
replyporridgeraisin 2 hours ago
Pcie dma uses BAR registers setup by cpu. It will contain information about the physical memory address for one. On newer systems, there is NVLINK C2C which is more tightly integrated and less general.
replyRegardless, my point was the the article is about vram.
However, there is one situation when vram access itself uses the bar, to be fair. When you do P2P dma, code (kernel, either the inbuilt version or the one in the nvidia driver) running on the cpu sets up the DMA engines's GART to contain the BAR1s of the other.
Or you could just use the AMD isa.