Jump to content

How many lines of code in a graphics driver?

mr195

Was just wondering if anybody had information or a link that contains information about roughly how many lines of code make up an Nvidia and or AMD graphics driver. Thanks!

Link to comment
Share on other sites

Link to post
Share on other sites

No one can tell you that but you can find out by decompiling it which is illegal so you won't know unless someone knows

 

PS: This is derp answer

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

counting the individual shader code bugfixes?

as a reference, programmers in India get paid like $0.50 per 1000 lines of code

 

if you're not counting the patches for games, then your best estimate would to look up a linux open source driver

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, mr195 said:

Was just wondering if anybody had information or a link that contains information about roughly how many lines of code make up an Nvidia and or AMD graphics driver. Thanks!

Not sure. Rather a lot, I'd imagine.

Project White Lightning (My ITX Gaming PC): Core i5-4690K | CRYORIG H5 Ultimate | ASUS Maximus VII Impact | HyperX Savage 2x8GB DDR3 | Samsung 850 EVO 250GB | WD Black 1TB | Sapphire RX 480 8GB NITRO+ OC | Phanteks Enthoo EVOLV ITX | Corsair AX760 | LG 29UM67 | CM Storm Quickfire Ultimate | Logitech G502 Proteus Spectrum | HyperX Cloud II | Logitech Z333

Benchmark Results: 3DMark Firestrike: 10,528 | SteamVR VR Ready (avg. quality 7.1) | VRMark 7,004 (VR Ready)

 

Other systems I've built:

Core i3-6100 | CM Hyper 212 EVO | MSI H110M ECO | Corsair Vengeance LPX 1x8GB DDR4  | ADATA SP550 120GB | Seagate 500GB | EVGA ACX 2.0 GTX 1050 Ti | Fractal Design Core 1500 | Corsair CX450M

Core i5-4590 | Intel Stock Cooler | Gigabyte GA-H97N-WIFI | HyperX Savage 2x4GB DDR3 | Seagate 500GB | Intel Integrated HD Graphics | Fractal Design Arc Mini R2 | be quiet! Pure Power L8 350W

 

I am not a professional. I am not an expert. I am just a smartass. Don't try and blame me if you break something when acting upon my advice.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

...why are you still reading this?

Link to comment
Share on other sites

Link to post
Share on other sites

A rather pointless question, since a graphics driver is usually made up of multiple source files, not just one.

 

Suffice to say, quite a lot.

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

Who knows really, it's closed source, protected from the light of day. If you're very curious try calling on some developer from Nvidia or AMD they might tell you, I don't think it's all that confidential to cover the scale of the project anyway. Another option would be to check out open-source drivers that are present in the linux kernel code, that might tell you something, but they are minimalist mostly, the in-house drivers will be much bigger I bet. Decompiling won't tell you anything either, these kind of tools cannot decompile code design.

Link to comment
Share on other sites

Link to post
Share on other sites

What counts as a "driver" is up for some debate. Discounting things like an OpenGL ICD, "control panels", OpenCL Driver, etc. you're looking at something on the order of 10k lines of C and about 50% more buried in header files to produce something useful. Support for multiple generations of hardware, interfaces for your Windowing system, will increase that further.

 

$ wc -l `find ./xf86-video-ati/src -name radeon*.h`
…
10162 total

$ wc -l `find ./xf86-video-ati/src -name radeon*.c`
…
17100 total

 

Talking to hardware is easy, exposing an API—either one defined by some operating system, standard, or something you designed yourself to support "real" development—is considerably more work. The ATI drivers above get you far enough to along to start speaking with X11. That will let you run something like CDE/Motif and is a good foundation for implementing a useful drawing API like OpenGL on top of it.

 

If you're not trying to expose a particular API, you could write enough of of a VESA driver too make a star-field simulator in a couple hundred lines of x86 assembly, or a few tens of lines of C.

Link to comment
Share on other sites

Link to post
Share on other sites

Last I heard the Nvidia drivers were in the 10's of millions of LOCs. The Linux drivers are enormously cut down compared to what is happen on windows and such.

Link to comment
Share on other sites

Link to post
Share on other sites

On 27/04/2016 at 9:12 PM, DXMember said:

as a reference, programmers in India get paid like $0.50 per 1000 lines of code

Is that a thing?! Like Indian call-centers but for software?! What would they write? How would a company trust these people?

 

I am really intregued O.o

CPU: i5 4670k @ 3.4GHz + Corsair H100i      GPU: Gigabyte GTX 680 SOC (+215 Core|+162 Mem)     SSD: Kingston V300 240GB (OS)      Headset: Logitech G930 

Case: Cosair Vengance C70 (white)                RAM: 16GB TeamGroup Elite Black DDR3 1600MHz       HDD: 1TB WD Blue                              Mouse: Logitech G602

OS: Windows 7 Home Premium                       PSUXFX Core Edition 750w                                                Motherboard: MSI Z97-G45               Keyboard: Logitech G510

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×