Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 02-Jul-2012, 00:58   #1
joh
Registered
 
Join Date: Jul 2012
Posts: 4
Default Beginning graphics driver development?

My goal is ultimately to learn more about GPU architecture and graphics driver development. I'd like to try implementing a 2D kernel space and user space driver, as I've been advised that that is a much easier project when familiarizing oneself with driver development. (I have no driver or kernel dev experience and little linux experience. I've been a OS X developer my whole life however, so I am familiar with the unix environment).

My problem is two-fold:

(1) I'm struggling to find a hobbyist-oriented linux box on the market that uses a well-documented graphics card, or for that matter finding any kind of documented GPU. I'm looking for something with a similar price point as the BeagleBoard (which uses the closed-source PowerVR SGX). If something like that doesn't exist, I believe my only other alternative may be to work with the much more complicated Sandy Bridge integrated chip, as I have one in my laptop and it seems to be well (but tersely) documented at intellinuxgraphics.org.

(2) Given either direction I go with in point 1, I'm still vague on how to actually communicate with a graphics card. After some digging in the intel linux drivers, it seems that it all boils down to essentially libdrm (which I believe to be the kernel space API vendors must implement for each card...?) calling ioctl on a file in /dev corresponding to the graphics card. Is that correct?

Thank you to anyone who can shed some light on my questions and help me along!
joh is offline   Reply With Quote
Old 03-Jul-2012, 23:47   #2
Dominik D
Member
 
Join Date: Mar 2007
Location: Wroclaw, Poland
Posts: 578
Default

Don't want this to sound like an ad but why don't you just join Imagination Technologies? We're hiring for driver dev positions in all locations (UK, Poland, India,...).

As for the original question - if what you care about is "how do I write a driver?", you could take the "no hardware" approach and work on a driver, that doesn't really talk to any specific HW. It should be pretty easy with 2D graphics: at the end of your data path in KMD don't hand data over to HW via DMA; instead produce a usable dump that can be fed into something. For 2D raw data dump + commands for the ImageMagick or GraphicsMagick should be enough for starters.
__________________
Shifty Geezer: I don't think the guy really understands the subject.
PARANOiA: To be honest, Shifty, what you've described is 95% of Beyond3D - armchair experts spouting fact based on the low-level knowledge of a few.

This posting is provided "AS IS" with no warranties, and confers no rights.
Dominik D is offline   Reply With Quote
Old 04-Jul-2012, 21:42   #3
joh
Registered
 
Join Date: Jul 2012
Posts: 4
Default

Haha, perhaps someday, but as it be I am still working through my schooling. I have certainly considered the possibility however!

I've considered that route and that is my backup plan. I think you're right in that it would still provide a lot of valuable driver development experience. It would perhaps also be good practice for designing graphic driver interfaces so if in the future I do find what I'm looking for (a simple and well documented graphics card), I could write a backend for my KMD that would interop with the hardware. If you don't mind me asking you Dominik, assuming you work at Imagination Technologies (which I think is a fair assumption to make :P), what was your first exposure writing drivers and first exposure writing drivers specifically for a graphics stack?

I just may take the route you're suggesting, but my original question still stands about the availability of any such graphics hardware and I hope others still chime in .
joh is offline   Reply With Quote
Old 05-Jul-2012, 10:37   #4
Dominik D
Member
 
Join Date: Mar 2007
Location: Wroclaw, Poland
Posts: 578
Default

I haven't been working on drivers prior to joining Imagination at all. I used to work on Volume ShadowCopy Service, user mode infrastructure component that's part of Windows. This however gave me all of the important skills when developing under windows: understanding of the platform and its APIs, familiarity with tools (build infrastructure, WinDbg, scripting), and so on. I also used to do some lame stuff on the demoscene* which gave me the necessary background in graphics programming.

The reality is that in the production environment you won't write code from scratch 99% of the time. I didn't have to figure out how UMD talks to KMD via DXGK, got here after people way smarter than me wrangled that. And since understanding well written code is much easier than writing one, the whole ordeal of context management and data passing was easier to grasp going through the existing codebase rather than trying to figure it out from the documentation and sample code.

On that note - have you considered looking at the VirtualBox code? This could be a good starting point and a great working environment at the same time. That said it's worth mentioning that working with existing code can make it hard for you to work on a competing product, so keep that in mind. Not a lawyer however, could be it's absolutely OK and NDA/GPL spoil are just some artifacts of my paranoid imagination. ;]


*no, demoscene is not lame - my stuff was :P
__________________
Shifty Geezer: I don't think the guy really understands the subject.
PARANOiA: To be honest, Shifty, what you've described is 95% of Beyond3D - armchair experts spouting fact based on the low-level knowledge of a few.

This posting is provided "AS IS" with no warranties, and confers no rights.
Dominik D is offline   Reply With Quote
Old 07-Jul-2012, 05:30   #5
joh
Registered
 
Join Date: Jul 2012
Posts: 4
Default

That's encouraging to hear that companies are willing to hire without prior (professional) experience in the subfield. Thanks for sharing your background .

I do understand that I will never be asked to write much of the foundation code I would have to write for a hobby driver, but I think that's half the fun and a good educational opportunity.

I think I will stay away from VirtualBox purely because of the GPL license. I share your fear of potential GPL lawsuits down the road :P.
joh is offline   Reply With Quote
Old 07-Jul-2012, 08:19   #6
Arwin
Now Officially a Top 10 Poster
 
Join Date: May 2006
Location: Maastricht, The Netherlands
Posts: 12,879
Default

Would the Raspberry be suitable for this kind of thing?
Arwin is offline   Reply With Quote
Old 07-Jul-2012, 13:09   #7
Dominik D
Member
 
Join Date: Mar 2007
Location: Wroclaw, Poland
Posts: 578
Default

Quote:
Originally Posted by joh View Post
That's encouraging to hear that companies are willing to hire without prior (professional) experience in the subfield.
It's such a niche that it's pretty much given you don't have prior experience in this very field. Besides - a lot of what you end up doing has to do with internal architecture of the hardware which you pretty much can't learn not working for the given company so even if you transfer from, say, AMD to NVIDIA, you're starting from scratch with a new codebase, different architecture, tools, etc. You'll get up to speed faster but it's not like you know everything.
__________________
Shifty Geezer: I don't think the guy really understands the subject.
PARANOiA: To be honest, Shifty, what you've described is 95% of Beyond3D - armchair experts spouting fact based on the low-level knowledge of a few.

This posting is provided "AS IS" with no warranties, and confers no rights.
Dominik D is offline   Reply With Quote
Old 07-Jul-2012, 16:55   #8
3dcgi
Senior Member
 
Join Date: Feb 2002
Posts: 2,019
Default

Dominik explained it well. It would be a rare school that taught driver development. Coding skills are essential and graphics knowledge very helpful. If you learn driver development on your own and like it enough to continue professionally you'll surely stand out amongst your peers.
3dcgi is offline   Reply With Quote
Old 07-Jul-2012, 17:20   #9
ERP
Moderator
 
Join Date: Feb 2002
Location: Redmond, WA
Posts: 3,155
Default

Quote:
Originally Posted by Arwin View Post
Would the Raspberry be suitable for this kind of thing?
There isn't any low level documentation on the GPU.
Same is true of the TI OMAP processors used in the Beaglebone etc, I really don't understand the secrecy.

It's irritating for me because my particular application is extremely timing critical and would be much better without the OS overhead.

I really don't see how exposing the control registers and Buffer formats would in anyway compromise the IP of the GPU manufacturers.
ERP is offline   Reply With Quote
Old 07-Jul-2012, 23:02   #10
joh
Registered
 
Join Date: Jul 2012
Posts: 4
Default

Quote:
Originally Posted by Dominik D View Post
It's such a niche that it's pretty much given you don't have prior experience in this very field. Besides - a lot of what you end up doing has to do with internal architecture of the hardware which you pretty much can't learn not working for the given company so even if you transfer from, say, AMD to NVIDIA, you're starting from scratch with a new codebase, different architecture, tools, etc. You'll get up to speed faster but it's not like you know everything.
I was starting to get that impression. Though there are definitely downfalls to this aspect (longer adjustment period when switching jobs, less sharing within the industry, etc), the fact that with each judge one is guaranteed to learn a lot is an exciting prospect.

Quote:
Originally Posted by 3dcgi
Dominik explained it well. It would be a rare school that taught driver development. Coding skills are essential and graphics knowledge very helpful. If you learn driver development on your own and like it enough to continue professionally you'll surely stand out amongst your peers.
That will just be an added bonus .


Would Linux on the PS3 be a good platform? I remember a couple of years ago when I was looking into PS3 development, there wasn't any hardware accelerated graphics yet, but maybe this has changed?
joh is offline   Reply With Quote
Old 10-Jul-2012, 21:40   #11
Davros
Darlek ******
 
Join Date: Jun 2004
Posts: 9,489
Default

Quote:
Originally Posted by ERP View Post
I really don't see how exposing the control registers and Buffer formats would in anyway compromise the IP of the GPU manufacturers.
If they did that would it become like early cpu programming (maybe soundcard programming would be a better example)
put value X in register Y issue interrupt Z ?
__________________
Guardian of the Most holy Two Terabytes of Gaming Goodness™
Davros is offline   Reply With Quote
Old 14-Jul-2012, 21:02   #12
imaxx
Junior Member
 
Join Date: Mar 2012
Location: cracks
Posts: 53
Default

Quote:
Originally Posted by joh View Post
the fact that with each judge one is guaranteed to learn a lot is an exciting prospect.
IF you want to be serious about driver development and dont want to make like many guys that should do something else than playing at r0...

1. buy subverting the windows kernel book, and learn to write your own rootkit under winxp (leave away vista+ for now).

2. download the old ddk for winxp (or the new one and use the old one for xp), leaving away the MS framework... just write something easy to start on (DONT even think to support a tenth of what MS tells you should do support, life is short...).

3. set up a proper debug environment: take a VM and install XP, and set up winDBG for remote debugging OR use Syser debugger OR (ahem...) SoftICE (supposing you alreay have a license you forgot from old times ofc). You dont have nice R3 debuggers there.

4. Learn x86 assembler and IA32 details (no need to read in full the Volume 2 of intel, any way... unless you want to go really deep).

5. In the book listed at (1) you'll discover many important things that change in Kernel mode, and much information about the way windows works internally (IDT, paging, SSDT, miniport and so on).

Let me suggest you to start doing something easy yet funny: make a simple driver that exports a standard interface and start adding (gradually) commands to it.

Ah, just remember that when you play with processor's structures (IDT), you'll have to understand how to change them on ALL processors/cores.

...all in all... have fun!
r0 coding (and debugging) can be VERY funny
...recently i aided a colleague writing his own r0 driver -he had alot of troubles with it, giving me a lot of fun discussing with him about possible problems and solutions

ah, as an additional note... buy the IDA Pro reversing book's of Chris Eagle. I cant imagine r0 coding without reversing the kernel

ps: a trick and a valuable suggestion to pin into the side of your monitor ...always, always remember to validate the memory area you go to read or write... memory tends to disappear randomly

Last edited by imaxx; 14-Jul-2012 at 21:13.
imaxx is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:03.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.