How does the graphics driver programmatically communicate with the CPU on the GPU?

I quite a long time wondered how processor instructions can interact with the GPU. As far as I understand, the processor has a certain set of instructions (machine code) that it understands and executes, and the driver is part of the software that passes through the processor to the GPU.

But how does this piece of software communicate? Does the CPU have specific assembly instructions that explicitly state that it is communicating with another device?

Can I write assembly code or C / C ++ code to communicate with the graphics card, just as the driver gave a specific environment for the computer?

+4
source share
4 answers

Like any hardware device on a PC, the graphics card will respond to reading and writing to specific memory addresses and, possibly, to the input / output ports. The PCI bus determines how they are distributed.

There are no specific CPU instructions for communicating with video cards; in the case of writing to memory cells, it simply uses the usual instructions for this, and in the case of the IO port, it simply uses general instructions for this. In both cases, there will be some CPU tuning necessary to “map” memory locations in the virtual address space or to access ports.

1234567 ​​ , , . ( , ) , , , , , , , , , , . , , .

+6

, . , , , . , . , , GPU . , , , , GPU DMA, CPU DMA.

, : GPU , GPU, , , , , GPU .

+3

, . -, , (ethernet/internet). , pcie (, , USB ..), Usb (, ..), , , ( - ).

, - , , , , , - , , , blob - . , - , - , , . , gpu, , , , , , , , , , , (mac- , ).

. /, , , , , -. , , . , , .

CPU . CPU , / , , , . , , , , , , , .

, - - , , , ( 123, , , , , , ), , .

+1

, . , .

CPU, / , /.

, , , GPU, / DMA PCI; , , .

, .

, , .

-1

All Articles