You are not logged in.

#1 2009-05-29 04:20:36

Odysseus
Member
Registered: 2009-02-15
Posts: 141

Howto: KMS on Nvidia hardware.

The Fedora 11 Beta has it, so why cant we?  Well you can too, and it's not very hard either! I have to warn you though, I am unable to get Xorg to run while modesetting is enabled,  My card is an 8400M GS, but you may have more luck than me,

The basic idea is that you just need to modify the nouveau-drm package to pull from the "modesetting-gem" git branch rather than master.  The reason this is not already done is, of course, because of the Arch Way.  Once modesetting gets merged into the master branch, this will no longer be necessary.

Step 1: Get the stock PKGBUILD 'n stuff.  The fastest way is to just use abs:

abs extra/nouveau-drm
cp /var/abs/extra/nouveau-drm -r .

Step 2: Modify PKGBUILD.  You can use the one provided here or just modify the stock one.  The main (actually, only) differences are that the pre-made arch linux source tarball isn't needed and instead we pull the source directly from the freedesktop.org drm git repository, and then checkout the modesetting-gem branch. The PKGBUILD provided could be better, but it works well enough.

pkgname=nouveau-drm
pkgver=20090528
_gitdate=20090528
pkgrel=1
pkgdesc="nvidia opensource X driver"
arch=('i686' 'x86_64')
url="http://nouveau.freedesktop.org/"
makedepends=('git' 'autoconf' 'pkgconfig')
depends=("kernel26>=2.6.29" "kernel26<2.6.30" 'udev>=141' 'cairo')
install=${pkgname}.install
license=('GPL')
source=(dont_check_for_pthread.patch)
md5sums=('237f3cdb1bfc5c62bfa7b038b7a20b2a')

build() {
  # get git code
  cd ${srcdir}
  git clone -v git://anongit.freedesktop.org/git/mesa/drm/
  cd drm
  git checkout --track origin/modesetting-gem

#  git archive --prefix=mesa-drm-${_gitdate}/ --format=tar HEAD | bzip2 > ../../mesa-drm-${_gitdate}.tar.bz2
#  return 1

  # build the drm kernel module
  # make sure the system kernel doesn't have "drm" set to "yes", 
  # default Arch kernel26 has it as module drm.ko, make sure it's not loaded
  # cd ${srcdir}/mesa-drm-${_gitdate}
  patch -Np0 -i ${srcdir}/dont_check_for_pthread.patch || return 1
  ./autogen.sh --prefix=/usr # --enable-udev --disable-option-checking
  cd linux-core
  make DRM_MODULES="nouveau" || return 1
  install -D -m 0644 drm.ko ${pkgdir}/lib/modules/`uname -r`/updates/drm.ko || return 1
  install -D -m 0644 nouveau.ko ${pkgdir}/lib/modules/`uname -r`/kernel/drivers/video/nouveau.ko || return 1
  install -D -m 0644 ../shared-core/nouveau_drm.h ${pkgdir}/usr/include/nouveau_drm.h || return 1
}

Step 3: Build, Install, and Insert.  This new kernel module now has the modeset parameter, just like the Intel module, Yay!  And you should make sure to unload any nvidia or other video drivers using the card before attempting to modprobe the nouveau kernel module in order to avoid very bad things.

makepkg -s
pacman -U nouveau-drm-*.pkg.tar.gz
modprobe nouveau modeset=1

As soon as you insert the new modesetting module, your console resolution will switch to the native resolution of your display and you are all ready to go!  Adding the new module to your initrd or grub entry should roughly follow the same steps as with the intel drivers.

Last edited by Odysseus (2009-05-29 04:29:09)


I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.

Offline

#2 2009-05-29 08:25:29

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Howto: KMS on Nvidia hardware.

Looks like KMS is still a good way off for the proprietary nvidia drivers.  Good tip Odysseus.  How is support for 3D coming along in nouveau?


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#3 2009-05-29 09:07:51

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: Howto: KMS on Nvidia hardware.

Yeah, how about 3D. When it reaches 3/4 performance of proprietary im switching.

Offline

#4 2009-05-30 00:42:41

Odysseus
Member
Registered: 2009-02-15
Posts: 141

Re: Howto: KMS on Nvidia hardware.

I don't think it's really supported at all.  I've heard it will work for a little while before crashing because of memory leaks or other bad things.
Here's how to try it if you really want to: http://nouveau.freedesktop.org/wiki/GalliumHowto

On the other hand, 2D is in great shape with EXA acceleration.  If you don't need 3D, there's no reason not to switch.

Last edited by Odysseus (2009-05-30 00:45:32)


I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.

Offline

#5 2009-05-30 00:47:06

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: Howto: KMS on Nvidia hardware.

i was thinking that the current arch package has disabled kms.


Give what you have. To someone, it may be better than you dare to think.

Offline

#6 2009-06-07 11:56:13

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Howto: KMS on Nvidia hardware.

nouveau supports KMS only for GF series 8 or higher, doesn´t it? I use a 6600 GT AGP. No chances I suspect...

Offline

#7 2009-09-23 12:14:06

trapanator
Member
From: Italy
Registered: 2009-08-10
Posts: 151

Re: Howto: KMS on Nvidia hardware.

I've tried KMS on my Geforce 5200 go and it worked... (Fedora 12 alpha live usb)

Offline

#8 2009-09-23 12:18:54

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: Howto: KMS on Nvidia hardware.

On my 8800 GTS I still cant even get 2d accel to work, ill give it another go sometime.

Offline

#9 2009-09-23 12:21:16

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Howto: KMS on Nvidia hardware.

They are working on a support for older hardware. Hopefully the nouveau driver will benefit from that too.

Offline

#10 2009-09-23 18:08:19

thn81
Member
Registered: 2009-08-27
Posts: 88

Re: Howto: KMS on Nvidia hardware.

Odysseus wrote:

The basic idea is that you just need to modify the nouveau-drm package to pull from the "modesetting-gem" git branch rather than master

The main development is now being done in the git://anongit.freedesktop.org/git/nouveau/linux-2.6 repository. It already contains modesetting and TTM. But, beware, checking this out will get you a complete kernel tree! http://people.freedesktop.org/~pq/nouveau-drm contains daily snapshots of the drm driver code only.
The 2D driver is in a fairly good condition but, according to the developers, you need a very recent (upcoming 1.7) xserver for some features to work. The 3D driver, however, is incomplete and only supports some basic operations (glxgears works). I think the nouveau devs are concentrating themselves right on the DDX(2D) driver because that's what most people are looking for.

Offline

#11 2009-09-23 19:42:26

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: Howto: KMS on Nvidia hardware.

wait. the pkg in testing has KMS included! it's all in the drm module for kernel 2.6.31.x - just boot the kernel with modeset=1 in appendline and you get kms enabled if you are lucky.

but be warned: http://bugs.freedesktop.org/show_bug.cgi?id=23847 ! loading the kms enabled kernel module is highly unstable and often crashing the kernel. If you can please help out fixing this together with upstream developers.

Offline

#12 2009-09-23 19:44:13

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: Howto: KMS on Nvidia hardware.

something different: please someone start a new nouveau wiki page with hints we collect. the intel driver page gives a good example.

Offline

#13 2009-09-23 20:14:35

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: Howto: KMS on Nvidia hardware.

Does that bug occur with BFQ or deadline?

Last edited by Zariel (2009-09-23 20:24:34)

Offline

#14 2009-09-23 20:16:53

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: Howto: KMS on Nvidia hardware.

yes and no. the nouveau-drm module is a replacement for the vanilla upstream drm module from the kernel26 pkg. we replace it with a more recent one including all latest nouveau stuff.

Last edited by AndyRTR (2009-09-23 20:18:17)

Offline

#15 2009-09-24 15:15:10

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Howto: KMS on Nvidia hardware.

Sounds interesting. Which chipsets are supported by the testing packages? Still no chance for older cards?

Offline

#16 2009-09-24 15:33:17

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Howto: KMS on Nvidia hardware.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#17 2009-09-24 17:02:52

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Howto: KMS on Nvidia hardware.

Thank you, I´ve read these pages some time ago. I will give it a try when 2.6.31 hits core.

Offline

#18 2009-09-24 17:19:15

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Howto: KMS on Nvidia hardware.

Zariel wrote:

Does that bug occur with BFQ or deadline?

As I mentioned in the bug report, the trace is not always in cfq code.

But I just checked yesterday, and yes, it also happens with other io scheduler like deadline or noop.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#19 2009-09-24 22:38:51

speed145a
Member
Registered: 2008-05-02
Posts: 60
Website

Re: Howto: KMS on Nvidia hardware.

maybe i'm just too lazy to see the problem, but when i use the PKGBUILD you posted above, i get:


Branch modesetting-gem set up to track remote branch modesetting-gem from origin.
Switched to a new branch 'modesetting-gem'                                       
can't find file to patch at input line 4                                         
Perhaps you used the wrong -p or --strip option?                                 
The text leading up to this was:                                                 
--------------------------                                                       
|diff -ru libdrm-2.4.0/configure.ac libdrm-2.4.0-nostubs/configure.ac           
|--- libdrm-2.4.0/configure.ac  2008-10-09 21:57:09.000000000 +0200             
|+++ libdrm-2.4.0-nostubs/configure.ac  2008-10-21 10:48:24.000000000 +0200     
--------------------------                                                       
File to patch:


ARCH x86_64 ZEN

Offline

#20 2009-09-25 04:27:06

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: Howto: KMS on Nvidia hardware.

Please everybody test the packages from testing repo. This is the latest upstream stuff and will be soon moved to core. kernel 2.6.31 is stable for all develeopers so far and safe to use for daily work.

Without kms I can start Xorg in about 80%, with kms enables it took me once 8 boots to get the kernel up then it was usable as usual. I haven't had any serious filesystem breakage. The kms crash is long before mouting the partitions in writable mode.

- help out to fix the kernel traces - all ideas are welcome. I'll help out wherever I can.
- write a wiki page how to setup nouveau and add hints and workarounds.

Trying different branches won't help us now. Nouveau upstream devs only support their main master branch (though only in a poor way).

Once we got nouveau running stable again I want to add 3D support from the Gallium 3D branch.

Offline

#21 2009-09-25 09:00:17

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Howto: KMS on Nvidia hardware.

I´ve tried the testing package with my 6600GT with modeset=1, however KMS is not working. Maybe my chipset is still unsupported. Apart from that the driver works nice.

Offline

#22 2009-09-25 09:06:01

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Howto: KMS on Nvidia hardware.

tyr0 wrote:

I´ve tried the testing package with my 6600GT with modeset=1, however KMS is not working. Maybe my chipset is still unsupported. Apart from that the driver works nice.

I thought it was nouveau.modeset=1

You can also add this to /etc/modprobe.d/modprobe.conf :
options nouveau modeset=1


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#23 2009-09-25 09:45:56

tyr0
Member
Registered: 2007-06-02
Posts: 152

Re: Howto: KMS on Nvidia hardware.

Thank you, you are right. Still get error messages and kernel crashes similar to those described by AndyRTR.
cimg5992.th.jpg

Offline

#24 2009-09-25 11:12:10

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: Howto: KMS on Nvidia hardware.

is this a x86_64 or i686 system? smp or single cpu system (looks single)?

mine is x86_64/smp

Offline

#25 2009-09-25 11:34:55

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: Howto: KMS on Nvidia hardware.

It was working fine with KMS, but now im getting a GPU lockup and hard lockup starting X, which killing my boot partition sad

Offline

Board footer

Powered by FluxBB