LWN.net Logo

On the possible merging of Nouveau

Some sites are reporting that the Nouveau driver (a reverse-engineered 3D driver for NVIDIA hardware) will be merged for 2.6.33. It is worth pointing out that this has not (yet) happened. Here's what has happened: the posting of the DRM tree for 2.6.33 drew a complaint from Linus that Nouveau was not there. A long discussion followed, culminating in the posting of a "Nouveau pony" tree. Linus may yet pull that tree, but it's worth noting that it's not a complete solution.

As was discussed at the 2009 Kernel Summit, NVIDIA hardware requires the downloading of a large binary blob to function. This blob was taken from NVIDIA's proprietary drivers. Nobody really knows what it is (though most guess that it is firmware), and nobody knows what sort of copyright restrictions might apply to it. So, for now, nobody's really willing to sign off on it for merging into the mainline. As a result, this blob is not part of the new tree; potential users will have to obtain it separately. Even this way, though, the merging of Nouveau would make it more visible and, hopefully, encourage more testing and development.

Update: Linus did pull the Nouveau tree into the mainline.


(Log in to post comments)

On the possible merging of Nouveau

Posted Dec 11, 2009 18:10 UTC (Fri) by yokem_55 (subscriber, #10498) [Link]

This blob was taken from NVIDIA's proprietary drivers.
More specifically, the nouveau developers watched the nvidia drivers write this data into the card using mmiotrace. Supposedly only small parts of the ctx_voodoo are visible in the actual nvidia binary, the rest is assumed to be generated on the fly.

Firmware not needed for all cards

Posted Dec 11, 2009 19:30 UTC (Fri) by ahuillet (subscriber, #40848) [Link]

Many of the older cards (up to and not including geforce6 series) do not require a binary blob to work with Nouveau. This information has been, perhaps voluntarily, omitted by the people who brought up the binary blob issue.
Nouveau without the binary blobs will be able to drive TNT and Geforce cards up to and including Geforce 5 series.

I believe it is worth mentionning this.

On the possible merging of Nouveau

Posted Dec 11, 2009 19:46 UTC (Fri) by koriakin (guest, #62470) [Link]

The blob situation is actually not as bad as it sounds. When mentioning the blobs, more properly called ctxprogs, it seems customary to call them "voodoo" and say "may or may not be firmware, who knows". This is not true anymore, we know a lot about ctxprogs these days, including their purpose [context switching], what they do [save/restore PGRAPH state], and most of their opcodes. There are still some unknowns that prevent us from writing new ctxprogs from scratch right now, but we're working on that and it *will* be resolved in the proper way. Which is throwing out nvidia's progs and writing our own prog generator. If you want to learn more about ctxprogs, http://0x04.net/cgit/index.cgi/nv50dis/tree/ctxdis.c

On the possible merging of Nouveau

Posted Dec 11, 2009 20:05 UTC (Fri) by foom (subscriber, #14868) [Link]

Neat stuff! There's so much good progress here.

It's just too bad it's despite nVidia, instead of with their help.

On the possible merging of Nouveau

Posted Dec 13, 2009 2:48 UTC (Sun) by MarkWilliamson (guest, #30166) [Link]

Is the blob needed for the card to operate at all or e.g. just for 3D
accelerated operation? If it's absolutely necessary then I am surprised
that Fedora distributed it without it's copyright status being known. But
it's a step on the road to a fully open stack for NVidia cards so I think
the work you're doing is excellent.

On the possible merging of Nouveau

Posted Dec 13, 2009 18:12 UTC (Sun) by koriakin (guest, #62470) [Link]

The ctxprogs are needed to make any use out of PGRAPH, which is the card's acceleration engine. Without them, there's no acceleration, not even 2D, but normal display, KMS, and suspend/resume works just fine.

On the possible merging of Nouveau

Posted Dec 11, 2009 21:17 UTC (Fri) by clugstj (subscriber, #4020) [Link]

"The driver alone is ~36,000 lines of code,"

Either that driver is way more complicated than it needs to be, or it's going to be a huge pain to maintain it.

On the possible merging of Nouveau

Posted Dec 11, 2009 21:32 UTC (Fri) by rahvin (subscriber, #16953) [Link]

It sounds like a lot but I would wager that there is a lot of code just to initialize the card and get things setup. I bet the code lines count includes code shared with other drivers. The 3D stuff is going to be very intensive but ultimately the Intel, ATI and Nouveau 3D code will be merged together as much as possible.

That's the whole point of FOSS drivers is that the same code doesn't have to be duplicated 15 times because it can share relevant libraries and code. Either way each individual GPU is going to require significant code just to initialize the processor and load up handling code. This is the result of the GPU moving from a specific processor with much of the work hard coded into the die (like the original geforce) to GPU's that are becoming generic enough to execute ordinary code but need extensive software initialization and handling. In fact this is the reason Nvidia gives for refusing to FOSS their drivers is that they have so much invested in them that they can't do it without giving away IP to competitors, implying that much of their work is in the software that drives the generic hardware.

On the possible merging of Nouveau

Posted Dec 11, 2009 21:49 UTC (Fri) by obi (guest, #5784) [Link]

Consider that nvidia's official binary kernel module (nvidia.ko) is 10 MEGAbytes. And it covers
a smaller range of hardware than nouveau does. I suspect the nouveau people are not doing
too badly.

On the possible merging of Nouveau

Posted Dec 11, 2009 22:37 UTC (Fri) by avik (guest, #704) [Link]

Are you comparing driver size or functionality and performance?

On the possible merging of Nouveau

Posted Dec 12, 2009 1:30 UTC (Sat) by obi (guest, #5784) [Link]

Well, driver size, since that was what the OP was talking about. (And considering I wasn't
counting the opengl/glx/userland/etc for either I considered it reasonably apples-to-apples).

On the possible merging of Nouveau

Posted Dec 12, 2009 1:42 UTC (Sat) by jengelh (subscriber, #33263) [Link]

The size of their driver grows linearly-or-more with the released chips. That should hint to the practice of copying an implementation file and refitting it to the new hardware. And given it's a serious business, they just cannot afford things like "oops, someone accidentally broke the legacy support for NV11 because they had to reshuffle the API for NV40 features"...so it is easier to copy the nv11.c to nv12.c, hack on nv12.c and let nv11.c mostly rest except for bugfixes.

On the possible merging of Nouveau

Posted Dec 12, 2009 0:58 UTC (Sat) by airlied (subscriber, #9104) [Link]

The radeon KMS driver is 71,000 loc, and this is just the kernel driver,
Intel is 35,000 LOC.

This doesn't include shared DRM components (TTM which radeon/nouveau share is 5k) and the drm/kms core is around 20k I'd guess

there is a larger component in userspace Mesa driver doing the shader compilers etc.

It just shows that GPUs are one of the most complex pieces of hw available today and why they need more hackers to work on them.

On the possible merging of Nouveau

Posted Dec 11, 2009 23:36 UTC (Fri) by pauliusz (guest, #49461) [Link]

Already in the mainline!

On the possible merging of Nouveau

Posted Dec 12, 2009 0:43 UTC (Sat) by aegl (subscriber, #37581) [Link]

Yup. Here's the merge in Linus' tree:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-...

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds