DE/EN/ES/FR/RU/Team |
The irregular Nouveau-Development companion
Issue for 27th Feb 2011
1. Intro
We apologise for the fact that there has been no TiNDC for almost two years, we hope this edition goes a long way towards improving our communication with the users of Nouveau. This article will mostly concentrate on progress being made adding support for Fermi (NVC0 family) cards to nouveau.
2. The Current Status
DISCLAIMER: I am not an expert on this, feel free to correct me.
2.1. Fermi support
Initial Fermi support landed in Linux 2.6.37 which was released the 5th of January.
The initial support was limited to un-accelerated 2D. This is still the case unless you are able to extract some firmwares from the blob and feed nouveau with it. If you manage to do that, you'll get feature-parity between the nvc0 and the nv50 drivers.
2.1.1. Reverse Engineering the Fermi Firmwares
As we consider illegal the fact to ship nvidia's firmwares, there is a strong focus on the reverse engineering of these firmwares.
You may wonder what takes us so much time? Well, first, nVidia introduced a new engine and language that we named FuC that stands for Fermi microcontroller. It was then renamed Flexible microcontroller when we found out that nv98 introduced it before, but on non-critical parts of the card.
2.1.2. More on FuC
So, what is fuc? FuC can be considered as a scripting co-engine. Instead of hardwiring (carving into --stone-- silicon) the engine logic (FIFO handling, IRQ/event handling, etc), you use the fuc co-engine to do this in software using a firmware.
Why would nVidia want to do that? Well, first, the card is more flexible, it is easier to fix a wrong firmware than a wrong hardware design. Secondly, it may be a way for nVidia to shrink the size of the die and thus, make more GPUs from a single wafer.
Is this good or bad news for nouveau? At first, very bad news but now that Marcin KoĆcielnicki has reversed engineered FuC, this is good news! Why? Simply because we can program more of the card to fit OUR needs, not the ones from nVidia
2.1.3. PDAEMON
Another FuC-related good thing, a new engine that we call PDAEMON has been introduced on nva3 cards. This engine is fuc-only and can be used to execute a fuc-written RTOS (Real-Time Operating System) that can interact with both the card and the host (read send IRQ and DMA). We can use this engine for power management and other things I don't think of.
2.1.4. FuC Compiler: Fermi microController Compiler (fucc)
Shinpei Kato, a Japanese efficiency researcher, started working on a llvm and cmake-based FuC compiler to simplify the development of alternative firmwares. The generated FuC code is then sent to envyas that assembles it into a working binary firmware.
The compiler works and will be published soon. Using it will reduce the legal risks of creating a new firmware (nVidia won't be able to claim we copied/extracted some parts of their firmware) and also make it more readable for people who don't feel like learning another assembly language.
2.1.5. The nvc0 gallium driver
The nvc0 gallium driver has been merged into mesa's master the 4th of January. It is now faster and more optimized (vertex submission and buffer allocation) than the nv50 driver.
Some (very promising) research results:
See calim(Christoph Bumiller)'s comment on this: Achieved same clock speed as the binary driver by loading it, letting it raise the clocks, and then doing \"kexec -f\" to reload linux, not giving it a chance to lower them again.
We sincerely hope these will be the same across the boards once it hits master but we can't guarantee anything.
2.2. Nouveau is a KMS-only video driver
Now, like intel and unlike radeon, nouveau can only be run on KMS. This move has been made to focus work on a single code-path, the one everyone wants. What this means is that, if you want open 2D/3D acceleration on nVidia cards, you need to use KMS and nouveau.
If nouveau crashes your computer, you can:
- Try to deactivate the hardware acceleration: Add nouveau.noaccel=1 to the kernel command line
- Try to blacklist the nouveau driver or add nouveau.modeset=0 to the kernel command line. If you need a graphic interface, you'll need to use Xorg's vesa driver.
Even though your computer will be dead slow, this should at least allow you to boot your computer.
2.3. New memory manager
I'm not the right person to ask for information about it, but the new memory manager brought some performance improvement on BO allocation (when you allocate a buffer in memory).
This lead to a great performance boost on 3D on nv50 because the nv50 gallium driver doesn't reuse previously-allocated-but-now-released BOs.
2.4. Pageflip
Another long-awaited feature has been page flipping. This feature adds performance and is also a step forward a tear-less graphic server.
The feature has finally been introduced the February, 7th.
2.5. Z-compression
Roughly speaking, Z-compression is a technique that, in some particular cases, allow the card to store a linear equation to represent the Z component of each pixel of a small tile. This technique is comparable to svg images versus bitmap images, you can get a tremendous compression using the first over the latter.
The problem of this technique is that you need to be able to find the mathematical linear equation that represents all the pixels's Z component, this is why it only works on some specific cases and also why the tiles are very small (8*4 in the best case).
If you want some more information about it and color-compression, you can look at the irc logs: http://people.freedesktop.org/~cbrill/dri-log/index.php?date=2011-02-28&channel=nouveau&highlight_names=&update=Update&date=2011-02-28 . It starts at 13h45.
Z-compression adds performance and will land in Linux 2.6.39.
2.6. nvfx/nv50 Gallium drivers
Even though we don't provide support on 3D, the gallium drivers are becoming more and more stable. In my opinion, you now can use Compiz/Kwin on a daily basis.
You may encounter crashes or instability with it. Often, the gallium driver just triggers bugs more easily, so if you find a bug, try reproducing it without the 3D driver and report the problem. If you can't, you're out of luck, we don't provide 3D support. You can still report your problem on IRC but don't expect anything from the nouveau devs.
As far as I can tell, nouveau should work fine on most games but maybe a bit slow. Look at the power management part if you want to get some information on how to improve the performance of your card.
2.6.1. nv50 performance
Concerning nv50's performance, it should improve a lot soon: Knowing that most of the improvements made within the nvc0 driver will soon be shared with the nv50 driver, we have reasons (and early benchmarks) to hope nv50's performance will improve a lot.
Here are the results of calim's research (on Open-Arena), this may be an ideal case: current: 90 fps, nvc0-branch: 140 fps, +zcomp: 170 fps, +pageflip: 190 fps
Edit (31.03.2011): You can now try it on your own. The support has been merged to mesa master. You'll need at least a 2.6.38 kernel but we recommend you use the nouveau kernel tree or linux 2.6.39-rc1.
2.7. Wayland
Since February 16th, you should be able to run both the X11 and the drm wayland compositor on nv40+ cards. There is still a lot of room for improvement but if you set a background, you should be able to run the apps.
For more information, please ask on the #wayland IRC channel on freenode.
2.8. Power Management
Power management covers fan/thermal management, changing the engine clocks (core, memory, shader, etc...).
Support for changing the clocks and reading the GPU temperature has been introduced in Linux 2.6.36 for most cards. Current work focuses on thermal management and reliable clock changing as we can't implement dynamic clock-changing without a guarantee that neither the hardware will overheat nor the computer will crash. This is a tricky and hardware-dependant task.
NVC0 support for power management is almost null. I hope to get my hands on an nvc0-family card soon.
The state of power management is summarized at http://nouveau.freedesktop.org/wiki/PowerManagement
PS: If by any chance, you have nv40+ (geforce 6+) cards that you don't need, please consider lending or donating them to nouveau devs to make the power management development faster.
2.9. 7 - The *lovely* bug 26980 AKA random lockup on nva3/5/8/f
If you have an nva3,5,8 or f, I bet you know what I'm talking about. Every once in a while, but up to several times a day, your computer would just lockup. Also, some people seem to be more affected by this bug than others.
We really don't know the cause of this bug. We are deeply sorry, we are trying our best to fix this, but we can't spend all our time on it, we need to move on.
If you're really affected by this bug, here are some work-around:
- Deactivate the hardware acceleration: Add nouveau.noaccel=1 to your kernel command line
- Use the now-unmaintained official open nvidia driver xf86-video-nv (if you can)
- Use the blob
- Get an older card or wait for the nvc0 support to become mainline and buy a cheap nvc0-family card
Here is the bug report on the freedesktop's bug tracker: https://bugs.freedesktop.org/show_bug.cgi?id=26980
Edit (31.03.2011): This commit may help with the situation. Please try it and report
Conclusion
We hope this new issue answered most of your questions. If you have more questions, please let us know so as we can address them in a future issue. We also hope you are excited about Nouveau's development, we certainly are.
Some other good news are coming, stay tuned (hopefully, it won't take another two years for the next issue to be released).