How to do 'from scratch GPU programming'?

Started by
18 comments, last by nullsquared 15 years, 9 months ago
I would like to know how I can send commands to the GPU through the CPU(assembly programming probably). Well, it is almost the samething as asking how is Direct3D/OpenGL implemented, how are they programmed? Any articles about? Its just a curiosity, to learn more about the very low level thing. Thanks.
.
Advertisement
Quote:Original post by xissburg
I would like to know how I can send commands to the GPU through the CPU(assembly programming probably). Well, it is almost the samething as asking how is Direct3D/OpenGL implemented, how are they programmed? Any articles about?

Its just a curiosity, to learn more about the very low level thing. Thanks.


It isn't possible to get direct access to your graphics card.

Even if it were possible you wouldn't want to work at that level. Programming at that level mostly involves direct register writes (which are completely different for each GPU). If you mess up, the GPU will hang, then you restart your computer.

OpenGL and D3D are implemented by your video card driver. These are written by kernel programmers.

If you are curious about this aspect of programming familiarize your self with the principles of operating systems first.
If you just want to harness the power of your GPU, you could try Cg, HLSL, or CUDA... :shrug:
Quote:Original post by xissburg
I would like to know how I can send commands to the GPU through the CPU(assembly programming probably). Well, it is almost the samething as asking how is Direct3D/OpenGL implemented, how are they programmed? Any articles about?

Certainly not. This kind of information is covered by trade secrets, and usually will not be released unless you pay very large amounts of money. AMD/ATI releases some 'dumbed down' register information (ie. none of the cutting edge features) for open source driver development. If you really want to do this (which I definitely do not recommend), you could start looking around the OSS Linux ATI drivers.
This is a bad idea for sure. Especially if you know nothing about the way a kernel works. *Start sarcasm* Pick up a book on kernel programming the Minix book comes to mind. You can get it for about $100 which will teach you the basics. Then get your self a linux distro and customize and play around with the kernel. While you are at it grab a ati video card because nvidia does not OSS its drivers. Then start poking around with the FGLRX drivers. When you fry your video card go buy and new one and try again. Eventually you should get the idea. *End Sarcasm*

No really it is a bad idea and not worth the trouble. If you want to get really low to the machine use Assembly and link to DX or GL from their but don't screw with the GPU.
Quote:Original post by blewisjr
When you fry your video card go buy and new one and try again. Eventually you should get the idea.


You cant fry the video card from the kernel. It is possible to do in the firmware however.

Quote:Original post by fpsgamer
You cant fry the video card from the kernel.

Yes you can. You can increase the GPU clock rate beyond its thermal tolerance level. NVidia even lets you do this from the driver panel, if you agree to a length legal agreement which will void all your warranty.
Quote:Original post by blewisjr While you are at it grab a ati video card because nvidia does not OSS its drivers. Then start poking around with the FGLRX drivers. When you fry your video card go buy and new one and try again. Eventually you should get the idea. *End Sarcasm*


As I said above Driver. And yes you can fry it from the kernel and the driver.
Okay but, how is Direct3D/OpenGL programmed then? How do they do that?
.
Quote:Original post by xissburg
Okay but, how is Direct3D/OpenGL programmed then? How do they do that?


Linux kernel video driver sources. Not the real thing, but about as close as you're likely to get.

As it happens, it's incredibly uninteresting stuff, including mostly magic numbers and debug output.

Then there's basically an API on top of that.

This topic is closed to new replies.

Advertisement