Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 126571

Summary: bug in kernel: amd64-agp fails to configure agp-bridge
Product: Gentoo Linux Reporter: Sebastian Volke <jungschar_basti>
Component: [OLD] UnspecifiedAssignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>
Status: RESOLVED OBSOLETE    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: http://bugzilla.kernel.org/show_bug.cgi?id=6350
Whiteboard: watch-linux-bugzilla
Package list:
Runtime testing required: ---
Attachments: kernel config of kernel I used when noticing the problem (2.6.14-gentoo-r5)
dmesg output of agp failure with kernel 2.6.15
dmesg output of succesful load after warm reboot from win**** with kernel 2.6.15
dmesg output of failure with kernel 2.6.16
dmesg output of a succesful load after warm start from windows with kernel 2.6.16
2.6.16 kernel config I used
At last a patch for this *** BIOS design flaw ;-)

Description Sebastian Volke 2006-03-17 11:16:18 UTC
Hello,

I got problems with the amd64-agp module since it can't setup my agp-bridge. It recognizes that there is one (at least) and doesn't report errors, but it says nothing about aperture size and such things.
When I then start my X-Server (using ATI's fglrx) it says "ERROR: enodev" and "cannot aquire agp". Therefore DRI and hardware acceleration won't work.

A (temporary) solution for this is, to boot windows which correctly sets up the AGP und then warm boot with gentoo. amd64-agp will then report the aperture size and fglrx (and with it the DRI) will load properly.

I think, that this is a bug in the kernel (I'm using 2.6.14-gentoo-r7 on amd64 --> generic x86_64 on a nforce3 mb), because it can be solved using (stupid) win****. ;-)

I hope it is not necessary to post my complete kernel config, for this bug is only related to the agp stuff. I turned off the IOMMU (to make agp accessible) and compiled agpgart and amd64-agp as modules. That should do it.

Please help.
Sebastian
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-03-17 11:36:48 UTC
Yes, we definitely need your kernel .config (attach, don't post), as well as emerge --info and relevant snip of dmesg output... Also, test with latest gentoo-sources before reopening this bug (2.6.15-r7 is even keyworded stable on amd64).
Comment 2 Sebastian Volke 2006-03-18 05:54:29 UTC
Created attachment 82453 [details]
kernel config of kernel I used when noticing the problem (2.6.14-gentoo-r5)
Comment 3 Sebastian Volke 2006-03-18 05:58:35 UTC
emerge --info gives following:

Portage 2.0.54 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.14-gentoo-r5 x86_64 AMD Sempron(tm) Processor 3000+
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-mtune=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="amd64 X alsa audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr crypt cups curl doc dri dvd dvdr eds emboss encode esd evo exif expat fam fbcon foomaticdb fortran gd gif glut gnome gpm gstreamer gtk gtk2 gtkhtml idn imlib ipv6 iqc javascript jpeg lcms ldap lzw lzw-tiff mad mng mozilla mp3 mpeg ncurses nls nsplugin ogg opengl oss pam pdflib perl png python qt quicktime readline sdl spell ssl tcpd tiff truetype truetype-fonts type1-fonts udev usb vorbis wxgtk1 xine xml2 xpm xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY



relevant dmesg output:
[...]
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected AGP bridge 0
agpgart: Setting up Nforce3 AGP.
[...]
[fglrx] Maximum main memory to use for locked dma buffers: 423 MBytes.
[fglrx] module loaded - fglrx 8.18.8 [Oct 25 2005] on minor 0
[fglrx:firegl_unlock] *ERROR* Process 11854 using kernel context 0

relevant Xorg.log parts:
(EE) fglrx(0): [agp] unable to acquire AGP, error "xf86_ENODEV"
(EE) fglrx(0): cannot init AGP
Comment 4 Sebastian Volke 2006-03-21 02:47:39 UTC
Problem reappears in kernel 2.6.15-gentoo-r7 (but I prefer staying on 2.6.14, 'cause it's the newest one that works with the stable ATI-driver.)
Comment 5 Daniel Drake (RETIRED) gentoo-dev 2006-03-21 03:33:46 UTC
Please reproduce on the latest kernel which is currently gentoo-sources-2.6.16. We also need to see complete dmesg logs from a boot where it does not work, and a warm boot where it does work.
Comment 6 Sebastian Volke 2006-03-25 06:30:30 UTC
Created attachment 83084 [details]
dmesg output of agp failure with kernel 2.6.15
Comment 7 Sebastian Volke 2006-03-25 06:31:20 UTC
Created attachment 83085 [details]
dmesg output of succesful load after warm reboot from win**** with kernel 2.6.15
Comment 8 Sebastian Volke 2006-03-25 06:31:51 UTC
Created attachment 83086 [details]
dmesg output of failure with kernel 2.6.16
Comment 9 Sebastian Volke 2006-03-25 06:33:33 UTC
Created attachment 83087 [details]
dmesg output of a succesful load after warm start from windows with kernel 2.6.16
Comment 10 Sebastian Volke 2006-03-25 06:34:19 UTC
Created attachment 83088 [details]
2.6.16 kernel config I used
Comment 11 Sebastian Volke 2006-03-25 06:40:50 UTC
I installed kernel 2.6.16 as you wanted, with the following results:
dmesg at a succesful load says:
...
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected AGP bridge 0
agpgart: Setting up Nforce3 AGP.
agpgart: AGP aperture is 256M @ 0xe0000000
...
which is the same as from kernel 2.6.15 and 2.6.14. I think, this is the "normal" output, as it should be.

When I don't have my northbridge set up by windows (I think, that is the problem after reading the amd64-agp source) or whatever it sets up, the output is this:
...
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected AGP bridge 0
agpgart: Setting up Nforce3 AGP.
agpgart: aperture base > 4G
...
which is at least an advancement, since 2.6.15 and 2.6.14 don't say _anything_ in case of a "failure".
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2006-04-01 04:34:42 UTC
Ok, thanks for collecting all that info. We now need to open an upstream bug report about this.

Please file a bug at http://bugzilla.kernel.org and post the new bug URL here.

Try and keep it simple - give a brief explanation of your hardware, the problem, the workaround, attach the two 2.6.16 dmesg logs, and illustrate the difference as you did in comment #11.
Comment 13 Sebastian Volke 2006-04-07 07:01:04 UTC
I reported the bug upstream.
Here's the link:
http://bugzilla.kernel.org/show_bug.cgi?id=6350

Thank you in advance for your help. ;-)
Please stay on the topic, now on kernel.org.
Comment 14 Sebastian Volke 2006-12-03 08:04:54 UTC
Created attachment 103272 [details, diff]
At last a patch for this *** BIOS design flaw ;-)

At last I actually did it, to work around this problem, which turned out to be a design flaw in the BIOSes of most K8-mother boards (look at bug #6350 at bugzilla.kernel.org).
I submitted the patch upstream, so it _may_ eventually be included into the kernel. But who knows if it happens, and when?

So I'll post it here again, with the request of it being included into the Gentoo kernel patch set, so that at least Gentoo users don't have to bother with this craziness.
The patch only changes one single file: {kernel-source-dir}/arch/x86_64/kernel/aperture.c, where it adds some 8 lines or so. It should be safe and not cause any instabilities. I myself use this patch (with kernel 2.6.17 and 2.6.18) for about a 2 weeks and didn't come over a problem, yet. At least one other human being tried this patch and didn't report problems up to now.
So I deduce, that it is pretty safe. Not just because it works, but simply have a look at the changes.

WARNING: I didn't try this patch with a multi-core or a multi-processor setup!!!
The patch works on a system with one single northbridge and works well there.

I'd like the Gentooers to benefit from it and test it a little, alongside.
Comment 15 Sebastian Volke 2006-12-03 08:07:04 UTC
So, now I reopen this bug in order to get the solution to the masses soon.
Comment 16 Daniel Drake (RETIRED) gentoo-dev 2006-12-03 17:00:03 UTC
We generally don't apply patches which aren't yet merged upstream. However I will try and find some time to review it and if appropriate make sure the relevant people are also looking at it.
Comment 17 Daniel Drake (RETIRED) gentoo-dev 2006-12-17 10:15:32 UTC
Closing until we have a resolution upstream