Live data from Hacker News

Ask HN: How does a CPU communicate with a GPU?

news.ycombinator.com

81–90 of 100 posts

Re: Ask HN: How does a CPU communicate with a GPU?

#81
post #66
post #45

Earlier quoted context omitted.

https://pcisig.com/sites/default/files/files/PCI_Express_Ele... It doesn’t say QAM explicitly but it has all the QAM terminology like 128 codes. Inter symbol interference etc. I’m not an RF guy by any stretch but it sounds like QAM to me. This is an old spec. I think it’s like equivalent to QAM-512 for PCIe 6

128/130b encoding is used to help embed a clock signal in the data stream. After every 128 bits of data, the receiver will see a preamble of 01 or 10. That voltage transition at predictable intervals helps the receiver keep the clock in sync. Intersymbol interference likewise applies to pretty much any high-speed digital transmissions. At high frequencies, you have to worry about things like the signal reflecting off…

Oh cool. Thanks for that. So basically it uses similar terminology because it’s modulated it’s just that QAM is a different kind of modulation?

Re: Ask HN: How does a CPU communicate with a GPU?

#82
post #81
post #66

Earlier quoted context omitted.

128/130b encoding is used to help embed a clock signal in the data stream. After every 128 bits of data, the receiver will see a preamble of 01 or 10. That voltage transition at predictable intervals helps the receiver keep the clock in sync. Intersymbol interference likewise applies to pretty much any high-speed digital transmissions. At high frequencies, you have to worry about things like the signal reflecting off…

Oh cool. Thanks for that. So basically it uses similar terminology because it’s modulated it’s just that QAM is a different kind of modulation?

It’s similar terminology because it’s dealing with sending digital signals at high speeds using analog signals. “Modulation” just means the scheme by which sequences of bits are represented in analog signals. There necessarily has to be some sort of modulation. But the terminology is more related to common issues that arise from the receiving end reading the small, rapidly changing voltages and recovering the bit stream. Regardless of the modulation you face similar problems with keeping the clock in sync etc.

Re: Ask HN: How does a CPU communicate with a GPU?

#83

At a high level, it's actually really simple. Your PCIe devices are each given a region of the address space, say, 0x8428000000000000-0x8428000000000fff. Just write to that region from kernel mode. But what do you write? Well, that isn't standardized. It's not even really documented. The best documentation is the source code to the GPU drivers in the Linux kernel, which are usually added to by engineers working at GP…

AMD does have some GPU register documentation for GCN at the bottom of https://developer.amd.com/resources/developer-guides-manuals... but not for RDNA / RDNA2.

Re: Ask HN: How does a CPU communicate with a GPU?

#84

Woah there, my dude. Let's try to understand a simple model first. A CPU can access memory. When a CPU performs loads & stores it initiates transactions containing the address of the memory. Therefore, it is a bus master--it initiates transactions. A slave accepts transactions and services them. The interconnect routes those transactions to the appropriate hardware, e.g. the DDR controller, based on the system addres…

Do you have a website to create such ´artwork´?

I find all these comments with the same typographic difficulty and I just want to work faster.

Can you help?

Ron.

Re: Ask HN: How does a CPU communicate with a GPU?

#85

Earlier quoted context omitted.

There's a nice guide by Ben Eater on Youtube about a breadboard computers: https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXN... It doesn't sport any modern features like DMA, but builds up from the core basics: a 6502 chip, a clock, and a blinking LED, all hooked up on a breadboard. He also built a basic VGA card and explains protocols like PS/2, USB, and SPI. It's a great introduction or refresher into th…

I was going to say, watching Ben Eater and building his 6502 machine myself filled in so many gaps in knowledge or fuzzy areas around basic computer hardware. If OP sees this he should definitely consider building some of these after Nand2Tetris.

This! except I (slightly redesigned and) built a common z80 setup, no comparison for knowledge gained from this single effort.

Re: Ask HN: How does a CPU communicate with a GPU?

#87
post #79

Earlier quoted context omitted.

Sorry pal! I remember playing Halo in my early 20's, and chatting with a guy from LA who was 34. Wow, he's so old, why was he still playing video games. Here I sit in my late 30's...still playing games when I have time, denying that I'm old, despite the noises I make getting up and random aches and pains.

OK. I am definitely old... - I have mostly no joy playing video games anymore these days. - I found myself refusing some contemporary stuff in favour of stuff "I am used to". Damn! I was always looking at my dad, not understanding that very same things :) Now I am a dad myself...

Haha same. I think the problem is that it seems to hit you all at once. I was pretty open minded and go with the flow until at least my early 30s, now I hate any kind of change at all.

Re: video games, I had a similar experience but play for different reasons. I used to have fun blasting people and chatting on xbox live... don't enjoy any of that anymore. All single player for me, and no FPS. A cool physics game like Rocket League(admittedly, not single player), or a puzzle game like The Turing Test, or a mystery game like Kona are way more interesting to me than say, Call of Duty.

Re: Ask HN: How does a CPU communicate with a GPU?

#88
post #62

Earlier quoted context omitted.

Is this before or after they read Knuth?

Mmm, do you know anybody who has read Knuth, really?

I own the books and I read parts of it.

But regardless, my point was that there are many many things that people say every programmer should read, and that sometimes includes Knuth. In fact, so many things that even if I stop everything I'm doing and just keep reading everything "every programmer should read", I will die before I finish.

tl;dr: it was a (bad) joke.

Re: Ask HN: How does a CPU communicate with a GPU?

#89

Woah there, my dude. Let's try to understand a simple model first. A CPU can access memory. When a CPU performs loads & stores it initiates transactions containing the address of the memory. Therefore, it is a bus master--it initiates transactions. A slave accepts transactions and services them. The interconnect routes those transactions to the appropriate hardware, e.g. the DDR controller, based on the system addres…

Do you have a website to create such ´artwork´? I find all these comments with the same typographic difficulty and I just want to work faster. Can you help? Ron.

Not sure if this addresses the speed issue, but here is one such tool https://asciiflow.com/#/ The download arrow lets you copy to clipboard.

And if you are an emacs user, you can try the artist-mode to draw with the mouse.

Re: Ask HN: How does a CPU communicate with a GPU?

#90
post #20

Lot of things happen there. But most important, PCIe bus is serial bus, which have virtualized interface, so there is no physical process of communication, what happen more similar to Ethernet network, mean on each device exists few endpoints, each has it's own controller with its own address and few registers to store state and transitions, and memory buffer(s). Videocards usually have many behaviors. In simplest mo…

> Recent additions where, add GPU possibility to read data from system disks, using mentioned before bus master, but those additions are not already wide implemented.

My impression is that high-end graphics cards (Nvidia RTX 30x and professional equivalents) more and more replicate parts of the PC architecture and become sort of mini-computers within a computer.

Following that logic, I wonder when we'll see the first card with its own dedicated flash memory - or why not a PCIe controller, so you can hook op an SSD...

Post reply on HN