Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto: KMS + nouveau
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Fran
Guru
Guru


Joined: 29 Feb 2004
Posts: 530
Location: Coruña (Spain)

PostPosted: Sun Apr 19, 2009 4:03 am    Post subject: Howto: KMS + nouveau Reply with quote

I haven't found information about getting KMS to work in gentoo with nvidia cards anywhere, so this is a howto for impatient people (like me) who want to try KMS. These instructions work in my system (see sig.) but may not work in more stable (obsolete :P) systems.

- First we need to patch the kernel with the latest Fedora 11 patches. These can be found (edit) here:

http://cvs.fedora.redhat.com/viewvc/rpms/kernel/F-11/drm-next.patch (only necessary for <=2.6.29 kernels)
http://cvs.fedora.redhat.com/viewvc/rpms/kernel/F-11/drm-modesetting-radeon.patch
http://cvs.fedora.redhat.com/viewvc/rpms/kernel/F-11/drm-nouveau.patch

They have to be applied in that order (i.e., drm-next -> drm-modesetting-radeon -> drm-nouveau) (edit) If you use a 2.6.30 kernel, you don't need drm-next, only drm-modesetting-radeon and drm-nouveu.

I've created an ebuild called nouveau-sources with these patches bundled to make things easier (only for 2.6.29). Simply uncompress the tar.bz2 in your overlay and emerge it. It's based on vanilla-sources, so no gentoo-patches here, sorry (I don't like them :)).

- Compile the kernel with support for nouveau and modesetting on nouveau (in drivers/graphics/direct rendering manager). (edit) Enable "Framebuffer Console support" in "Console display driver support".

- Install the x11 overlay (layman -a x11)

- Append live libdrm and mesa to package.unmask
Code:
=media-libs/mesa-9999
=x11-libs/libdrm-9999

(we don't need x11-drm because we are using the in-kernel version).

- Append "nouveau" to VIDEO_CARDS in make.conf and emerge the necessary packages:
Code:
emerge -1va mesa libdrm && emerge -va xf86-video-nouveau

Make sure you emerge the git (-9999) versions.

- Remove vga=xxx from the boot parameters in grub.conf (it's not necessary anymore :)). I have simply this
Code:
kernel /boot/vmlinuz-2.6.29.1-nouveau root=/dev/sda5 fastboot

and the LCD resolution is corretly detected at boot.

- Select the nouveau driver in xorg.conf. My xorg.conf looks like this:
Code:
$ cat /etc/X11/xorg.conf
Section "Device"
    Identifier     "nvidia"
    Driver         "nouveau"
EndSection



That's it. Reboot and it MAY work (it works in my geforce 8600M GT). The nouveau driver still has some issues (gallium still doesn't work well, suspend to ram doesn't work for me either) but at least the accelerated vt and the smooth switching between X and vt are great :P


Last edited by Fran on Fri Jun 12, 2009 8:56 pm; edited 4 times in total
Back to top
View user's profile Send private message
ashtophet
Guru
Guru


Joined: 08 Aug 2004
Posts: 396
Location: Galiza

PostPosted: Sun Apr 19, 2009 7:45 pm    Post subject: Reply with quote

I'll try it!

Thanks ;)
_________________
O coração, se pudesse pensar, pararia. Fernando Pessoa
If heart could think, it would stop
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 160

PostPosted: Mon Apr 20, 2009 7:23 pm    Post subject: Reply with quote

sadly i wasn't that successful. i followed your steps to the letter but ended up with all kinds of breakage, while i have a 9600M GS (supposedly just a higher clocked 8600M GS) :(
Back to top
View user's profile Send private message
Fran
Guru
Guru


Joined: 29 Feb 2004
Posts: 530
Location: Coruña (Spain)

PostPosted: Tue Apr 21, 2009 12:43 am    Post subject: Reply with quote

justinkb wrote:
sadly i wasn't that successful. i followed your steps to the letter but ended up with all kinds of breakage, while i have a 9600M GS (supposedly just a higher clocked 8600M GS) :(

Mmmm... the nouveau wiki says some cards don't work yet, but it only mentions 8200/8300 and some 9400. Is it an X problem or a kernel problem? Did the kernel at least boot in graphic mode? (It starts in text -80x24- mode, but it should switch to "graphic mode" -1440x900, or whatever your resolution is- before getting to openrc.) Can you post your dmesg and /var/log/Xorg.0.log?

(edit) I've replaced the patches in the ebuild tar.bz2 with those in the kernel-2.6.29.1-100.fc11.src.rpm package (latest fedora version). You can try those.

ashtophet wrote:
I'll try it!

Thanks ;)

Home, un paisano :)
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 160

PostPosted: Tue Apr 21, 2009 9:45 am    Post subject: Reply with quote

(i used the ones from the 2.6.29.1-100 package :))

first off, it wouldn't compile if i hadn't at least enabled one of the framebuffers (uvesafb or nvidiafb), then it would corrupt the display a short while after starting openrc. subsequently X would start up, i would get the characteristic blue gnome (gdm) background at first, but it would turn whitish and didn't show anything else anymore.

i've had trouble with nouveau without using the KMS also. X works "ok" like that, *but* it redraws GTK widgets like crazy in gdm (and possibly elsewhere too). i didn't try your ebuild but applied the patches manually btw (but i know how to do it ;))

i'm on another machine right now and the machine with the nvidia chip is about 10 km away and turned off :( so i can't really post or test anything else right now. maybe tonight.

edit: furthermore, i have virtually the exact same setup as you have in your sig, the only difference is i bumped the x11 xorg-server 1.6.0 to 1.6.1.
Back to top
View user's profile Send private message
Fran
Guru
Guru


Joined: 29 Feb 2004
Posts: 530
Location: Coruña (Spain)

PostPosted: Tue Apr 21, 2009 1:45 pm    Post subject: Reply with quote

justinkb wrote:
(i used the ones from the 2.6.29.1-100 package :))

first off, it wouldn't compile if i hadn't at least enabled one of the framebuffers (uvesafb or nvidiafb),

You're right, that's a bug in the fedora patches. It should select several kernel options (namely FB_CFB_FILLRECT, FB_CFB_COPYAREA and FB_CFB_IMAGEBLIT) when DRM_NOUVEAU is selected. I didn't have that problem because I had enabled the VESA framebuffer from a previous config, and that option selects the previous 3 options. Try disabling all framebuffer drivers and appending this patch to the ebuild after the other three patches:
Code:
--- a/drivers/gpu/drm/Kconfig   2009-04-21 19:23:58.569256295 +0800
+++ b/drivers/gpu/drm/Kconfig   2009-04-21 19:23:47.607006557 +0800
@@ -137,6 +137,12 @@
 config DRM_NOUVEAU
    tristate "Nouveau (nVidia) cards"
    depends on DRM
+   select FB_CFB_FILLRECT
+   select FB_CFB_COPYAREA
+   select FB_CFB_IMAGEBLIT
+   select FB
+   select BACKLIGHT_LCD_SUPPORT
+   select BACKLIGHT_CLASS_DEVICE
    help
      Choose this option for open-source nVidia support.

(or download my ebuild bundle, I've added this patch). This also takes care of selecting the necessary backlight options. Maybe in your case uvesafb or nvidiafb were interfering with nouveau :?. But if nouveau gave you problems without KMS it might be because the 9600 is not very well supported after all.

Oh, something I forgot in the howto: you have to enable "Framebuffer Console support" in "Console display driver support" to get a graphical boot and all the KMS goodness. Otherwise you'll just get your usual 80x24 console and you won't be able to switch between X and vtX.
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 160

PostPosted: Tue Apr 21, 2009 2:23 pm    Post subject: Reply with quote

yea i had that enabled... i'll try tonight with the Kconfig patch, uvesafb/nvidiafb may have been the culprit indeed.
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 160

PostPosted: Thu Apr 23, 2009 10:40 pm    Post subject: Reply with quote

got it working using more recent drm-rawhide patch from dave airlie, from here and then applying 30-drm-nouveau.patch and manually fixing one piece of code in drivers/gpu/nouveau/nouveau/... (can't remember) :) btw, is switching from terminal to X always fast for you? for me it's fast mostly, but it can lag sometimes...
Back to top
View user's profile Send private message
Fran
Guru
Guru


Joined: 29 Feb 2004
Posts: 530
Location: Coruña (Spain)

PostPosted: Fri Apr 24, 2009 12:13 am    Post subject: Reply with quote

justinkb wrote:
got it working using more recent drm-rawhide patch from dave airlie, from here and then applying 30-drm-nouveau.patch and manually fixing one piece of code in drivers/gpu/nouveau/nouveau/... (can't remember) :)

Weird, the patches for rawhide (fc10) and leonidas (fc11) should be kept in sync (or the leonidas ones be more recent). (edit) Oops, my bad, rawhide and leonidas are the same thing :P. fc10 is cambridge.

BTW, these are the direct links to the patches and their versions (better than downloading the big rpm and you can see if there are changes):

http://cvs.fedora.redhat.com/viewvc/rpms/kernel/F-11/drm-next.patch
http://cvs.fedora.redhat.com/viewvc/rpms/kernel/F-11/drm-modesetting-radeon.patch
http://cvs.fedora.redhat.com/viewvc/rpms/kernel/F-11/drm-nouveau.patch

justinkb wrote:
btw, is switching from terminal to X always fast for you? for me it's fast mostly, but it can lag sometimes...

From vt to X is always instantaneous, as if the vt was just a maximized terminal window in another desktop :). From X to terminal it may lag a bit the first time, but I think that's because of the composite manager (which has to be enabled for nouveau to have xv acceleration, a known limitation).

Now I hope nouveau gets suspend-to-ram soon, and it'll be all I need to replace the binary blob as my main driver.
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 160

PostPosted: Fri Apr 24, 2009 12:25 am    Post subject: Reply with quote

right indeed, VT->X is instant, X->VT can lag :) thanks for the links. here's one for you http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6.git;a=shortlog;h=drm-rawhide. this is mostly work on radeon drm, but there are some general drm changes in there too :)
_________________
~amd64 | gcc 4.4.2 | linux 2.6.33-git w/ alsa 1.0.22.1 and drm-radeon-testing | gnome(-light) 2.28.2 | xorg-x11 and xf86-video-ati from git


Last edited by justinkb on Fri Apr 24, 2009 10:08 am; edited 1 time in total
Back to top
View user's profile Send private message
M
Guru
Guru


Joined: 12 Dec 2006
Posts: 432

PostPosted: Fri Apr 24, 2009 7:36 am    Post subject: Reply with quote

Does kms now work also for nv40 cards or this is only for nv50 ? I read about a month ago that kms for now only works with newer cards, and I have 6100 onboard.
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 160

PostPosted: Fri Apr 24, 2009 10:01 am    Post subject: Reply with quote

those cvs patches are excellent, i'm gonna try those later today :D

edit: successfully switched to those now :)
_________________
~amd64 | gcc 4.4.2 | linux 2.6.33-git w/ alsa 1.0.22.1 and drm-radeon-testing | gnome(-light) 2.28.2 | xorg-x11 and xf86-video-ati from git
Back to top
View user's profile Send private message
Fran
Guru
Guru


Joined: 29 Feb 2004
Posts: 530
Location: Coruña (Spain)

PostPosted: Fri Apr 24, 2009 10:44 am    Post subject: Reply with quote

M wrote:
Does kms now work also for nv40 cards or this is only for nv50 ? I read about a month ago that kms for now only works with newer cards, and I have 6100 onboard.

Yep, it seems the fedora guys are concentrating their efforts on NV50 (G80) or newer, for now. I haven't tried this on anything else, though, so I don't know if it works.
Back to top
View user's profile Send private message
ashtophet
Guru
Guru


Joined: 08 Aug 2004
Posts: 396
Location: Galiza

PostPosted: Sun Jul 12, 2009 5:12 pm    Post subject: Reply with quote

M wrote:
Does kms now work also for nv40 cards or this is only for nv50 ? I read about a month ago that kms for now only works with newer cards, and I have 6100 onboard


Currently nouveaufb supports KMS on nv40. I'm using it on my box (flawlessly ;) ) with 7 days of uptime.

The patches commented here seem to be integrated in a nouveau kernel git repo, check nouveau official wiki for instructions.

cheers.
_________________
O coração, se pudesse pensar, pararia. Fernando Pessoa
If heart could think, it would stop
Back to top
View user's profile Send private message
tranquilcool
Veteran
Veteran


Joined: 25 Mar 2005
Posts: 1160

PostPosted: Mon Jul 13, 2009 7:43 am    Post subject: Reply with quote

works fine here kms and all with the git kernel.
the only thing i see is that it leaves the video card fan blowing continuosly.
nvidia-drivers has a better control of the card, at least fan wise.
_________________
this is a strange strange world.
Back to top
View user's profile Send private message
Spaulding
Apprentice
Apprentice


Joined: 16 Apr 2006
Posts: 159
Location: /dev/vagina

PostPosted: Tue Jul 14, 2009 8:11 pm    Post subject: Reply with quote

is this patches (radeon) works on radeon r250(radeon 9250) ? :) That would be nice to don't using uvesafb.
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2152
Location: Berlin, Germany

PostPosted: Sat Jul 18, 2009 8:59 am    Post subject: Reply with quote

Nouveau drm has since been removed from x11-base/x11-drm and now lives in its own package, x11-base/nouveau-drm. You will find live ebuilds in the x11 overlay, and snapshots in sunrise.

KMS should work now on nv40 and nv50, and possibly on previous chipset generations too. The following kernel settings are recommended for KMS to work:
Code:
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_DRM=n
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FB_VESA=n
CONFIG_FB_UVESA=n
CONFIG_I2C_ALGOBIT=y

Regarding GeForce 8300 support, some progress has been made in fdo bug 18286 but it still does not work properly.
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Sun Oct 04, 2009 3:47 pm    Post subject: Reply with quote

what kernel version do you people use? I tried to apply that radeondrm patch to 2.6.31 and there were some rejects (but only in radeon directory, so it should work if I don't use radeon, right?), nouveau applied cleanly but kernel fails to compile:

Code:
drivers/gpu/drm/drm_stub.c: In function ‘drm_fill_in_dev’:
drivers/gpu/drm/drm_stub.c:242: error: ‘DRM_MAP_HASH_ORDER’ undeclared (first use in this function)
drivers/gpu/drm/drm_stub.c:242: error: (Each undeclared identifier is reported only once
drivers/gpu/drm/drm_stub.c:242: error: for each function it appears in.)
drivers/gpu/drm/drm_stub.c:245: error: ‘DRM_FILE_PAGE_OFFSET_START’ undeclared (first use in this function)
drivers/gpu/drm/drm_stub.c:246: error: ‘DRM_FILE_PAGE_OFFSET_SIZE’ undeclared (first use in this function)
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2152
Location: Berlin, Germany

PostPosted: Mon Oct 05, 2009 1:17 pm    Post subject: Reply with quote

The patches from the OP are very old already, and will not work with current libdrm (due to API changes) anyway.
Back to top
View user's profile Send private message
cheater1034
Veteran
Veteran


Joined: 09 Sep 2004
Posts: 1558

PostPosted: Tue Oct 06, 2009 3:06 am    Post subject: Reply with quote

http://omploader.org/vMmhvMg

nouveau.diff

It's the latest nouveau git tree diffed over 2.6.31 (as in zen also ;)) - you don't need a drm-next patch or anything for that (nouveau git tree pulls drm-next anywho) - you don't want to be using the patches on the main post on 2.6.31.
_________________
IRC!: #zen-sources on irc.rizon.net
zen-kernel.org
--
Lost in android development land.
Back to top
View user's profile Send private message
larophel
n00b
n00b


Joined: 19 Mar 2005
Posts: 54

PostPosted: Mon Nov 23, 2009 3:01 pm    Post subject: Reply with quote

Sorry for bumping this old thread, but I am trying to use nouveau and I have come across something which I do not understand:

The nouveau-drm ebuild checks the kernel config for CONFIG_DRM being NOT set (also posted by chithanh).
Now, if I have CONFIG_DRM not set, I cannot select CONFIG_DRM_NOUVEAU, as it is in a submenu of CONFIG_DRM.

Is this an error in the ebuild? Or am I making a mistake? Should I select CONFIG_DRM and also CONFIG_DRM_NOUVEAU or should I not select either? Or is there a third option?
I tried manually un-setting CONFIG_DRM but leaving CONFIG_DRM_NOUVEAU in the kernel .config but as soon as I type "make", it gets corrected.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3390

PostPosted: Tue Nov 24, 2009 2:56 pm    Post subject: Reply with quote

larophel wrote:
Sorry for bumping this old thread, but


Thank you for bumping this old thread. I'm now having a pile of trouble with the proprietary nvidia-drivers and my T61P Thinkpad :
https://forums.gentoo.org/viewtopic-t-803953-highlight-.html
Philosophically I prefer the idea of Nouveau, OSS drivers, etc. It has just been so invasive, and looks like it would be so much trouble to switch to Nouveau and then back to nvidia-drivers that I haven't wanted to get into it. Unless I uncover soon what's going on with nvidia-drivers, it may well be time to switch to nv, vesa, or nouveau.

But nouveau appears to be a rapidly moving target, not the least reason that the kernel, xorg, and mesa are also rapidly moving targets. From what I can tell, the nouveau overlay is obsolete and the nouveau stuff in the sunrise overlay is deprecated. The regular HowTo doesn't cover KMS, but this one does. For that matter, from what I can tell, Gallium3D is now part of the standard Mesa that came along with the xorg-server-1.6.3 that is now stable.

Is this HowTo still the one to follow?
Are there really updates necessary, given that it's 6 months old and we've been through significant kernel, X, and nouveau activity since then?
Some time soon kernel-2.6.32 will be out, with more KMS, etc, though I've heard that the Nouveau stuff won't go in until 2.6.33.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
larophel
n00b
n00b


Joined: 19 Mar 2005
Posts: 54

PostPosted: Tue Nov 24, 2009 4:47 pm    Post subject: Reply with quote

Well, in the meantime I have gotten nouveau running and it works fairly well (much better than the nvidia-drivers, with those I was not even able to switch to the console after starting X without corrupting my display). If you plan on trying the nv drivers, check first if they support your graphic card. They did not support mine.
The only things that do not work right now is resuming from hibernate (although I have not spent any time figuring out why), and some artifacts which I am not able to reproduce consistently.
I used this guide: http://nouveau.freedesktop.org/wiki/GentooEbuilds it recommends the x11 overlay, not the sunrise or nouveau overlay.

My previous question still stands, though: does CONFIG_DRM have to be selected or not?
I just compiled my kernel with CONFIG_DRM and CONFIG_DRM_NOUVEAU and then commented CONFIG_DRM out to get the ebuild to install properly, without changing the kernel.
Back to top
View user's profile Send private message
ashtophet
Guru
Guru


Joined: 08 Aug 2004
Posts: 396
Location: Galiza

PostPosted: Tue Nov 24, 2009 10:12 pm    Post subject: Reply with quote

I'm not using x11 overlay, so I don't know how is its current status. Waiting for the someone who can answer your question, I'll tell you my solution:

I'm just using a vanilla kernel 2.6.31.6 (patched with BFS :P) and, following nouveau wiki instructions, using drm sections from nouveau git tree:

1.- Fetch nouveau git tree.
2.- ln ${NOUVEAU_SOURCES}/include/drm to ${YOURKERNEL}/include/drm and ${NOUVEAU_SOURCES}/drivers/gpu/drm to ${YOURKERNEL}/drivers/gpu/drm .
3.- etc (compile with appropriate .config options. See nouveau wiki).
4.- xf86-video-nouveau part: I compile it manually and install it via importare (paludis), anyway you could try x11 overlay ebuild.

Using this method flawlessly since May.

Alternatively to the kernel stuff you could use sys-kernel/zen-sources with drm-next USE flag enabled.

HTH
_________________
O coração, se pudesse pensar, pararia. Fernando Pessoa
If heart could think, it would stop
Back to top
View user's profile Send private message
larophel
n00b
n00b


Joined: 19 Mar 2005
Posts: 54

PostPosted: Wed Nov 25, 2009 4:25 am    Post subject: Reply with quote

Thanks a lot for your description! On my side, I am already using the zen sources.
So I take you have enabled CONFIG_DRM (prompt is: Direct Rendering Manager (XFree86 4.1.0 and higher DRI Support) in your kernel, then?

The reason I am so persistent with this question is that in the nouveau Install Wiki FAQ I found the following advice:
3.2 Make sure that you have not set CONFIG_DRM to yes in your kernel config.

If you could let me know whether you have set it to y, m, or unset I would be thankful. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum