Basic GPU Question

Hello,

I will like to know: Can the GPU communicate with (i.e. send back information to) the CPU?

  • Olumide

You can read back data from the various buffers (framebuffer, depth buffer, stencil buffer), and some specific extensions (occlusion query, nv_fence, etc) send data back as well

Originally posted by DopeFish:
You can read back data from the various buffers (framebuffer, depth buffer, stencil buffer), and some specific extensions (occlusion query, nv_fence, etc) send data back as well

I know. I know. But can the GPU communicate with the CPU???

Thanks

  • Olumide

I know. I know. But can the GPU communitate with the CPU???

well, you could get the graphics card to draw text in the frame buffer, capture that with glReadpixels and use OCR to interpret what the graphics card is trying to say.

Or, maybe you could use colours. The graphics card could fill the framebuffer with yellow when its happy, blue when its sad, red when its angry, green when its peaceful… that kind of thing.

I know this. What I will like to know is CAN THE GPU SEND BACK INFORMATION TO THE CPU???

Thanks

  • Olumide

The cpu can get information, but the GPU cant push it. is that clear enough?

to answer your question in general: no !
the communication between CPU -> GPU is oneway, this means that there is no regular (!) way to get your data back - there is no way to say to the GPU “hi GPU calculate the blabla out of blabla”, what you meant - but, as already mentioned above there are several way to workaround this problem; but don’t expect a good communication.

Olumide : no

SeskaPeel.

NV_fence is a form of GPU-to-CPU communication.

But thats also a poll test from the CPU side…

Mmm, so he means can the GPU call a function resident in system memory?
Without the CPU expecting communication with the GPU (using a message system like a fence) then callbacks are the only other way surely…
Right, I’ve wasted enough time on this rubbish…back to work!

What would be the point of this question?
WHat`s this about?

Originally posted by V-man:
What would be the point of this question?
WHat`s this about?

This is experimental. I’m thinking of farming out some software rendering tasks to the GPU.

I know … I know … the GPU is not a general purpose processor as its “instruction set” (if you can allow me to call it that) is quite limited …

Thanks for not being upset by my “uniformedness”

  • Olumide

yes, the GPU can communicate with the CPU, but all this is completely hidden inside the drivers .
Most piece of hardware in a PC can do this(and does)!
did you ever heard of something called “interrupts” ?
Everytime a hardware wants special attention from the CPU, it creates an “interrupt”, which causes the CPU to stop all curent processing and to call a perivously specified routine, wich handles whatever the hardware has requested.(this a very simplified description, if you want to know more, google for “interrupts”)

Originally posted by AdrianD:
yes, the GPU can communicate with the CPU, but all this is completely hidden inside the drivers,

Everytime a hardware wants special attention from the CPU, it creates an “interrupt”, which causes the CPU to stop all curent processing and to call a previously specified routine, wich handles whatever the hardware has requested.(this a very simplified description, if you want to know more, google for “interrupts”)

Finally, someone is telling me what I want to hear. I know what interrupts are. You’re right, interrupts CAN be used to send back informatiuon to the CPU but that requires that a seperate device driver be written.

Thanks

  • Olumide