mercoledì 14 luglio 2010

aTi 9600 and linux >= 2.6.33.4: a successfull story

I was tired, because with my Radeon I could get only 100 FPS. I'm on a PowerBook, so I tried OSX and I reached ~1500 FPS.

What a mess..

My system:
kernel 2.6.33.4, 2.6.35-rc4 to test
xorg 1.8.1
xf86-video-ati 6.13.0
ati-dri 7.8.1
mesa 7.8.1



So, start from Xorg.0.log (located, here, under /var/log). If you see "swrast_dri.so" anywhere, you're using the Software Rasterizer, instead of R300_dri. This means that all 3D operations are done by the CPU instead of GPU, which is soooo slow.

I checked the permission of /dev/dri/card0 (the entry-point for the system to my GPU):

[danimoth@jim ~]$ ls -l /dev/dri/card0
crw-rw---- 1 root video 226, 0 Jul 14 09:22 /dev/dri/card0


Wow! So I just added myself to video group (gpasswd -a danimoth video) and rebooted (I know, it isn't necessary, but I have done it). This part is done.. now, we need to have acceleration.


Now, If I want to load a kernel with modesetting enabled (like 2.6.35-rc4), I had a black screen every time I load the module radeon (at boot time.. so I couldn't do very much)..

To bypass this, in the kernel command line I added:


radeon.modeset=0

and, to avoid ppc problems, I added also

video=radeondrmfb

but this isn't much important. Remember that in your kernel you don't need radeonfb, because if you have this, KMS will not take ownership of GPU (but you don't want KMS, it's still fine).

Now, I can boot into my system, and I could do the magic thing:

# modprobe -r radeon drm
[The screen flickr.. is inusable.. but you could type]
# modprobe drm
# modprobe radeon modeset=1 agpmode=-1

The modset=1 switch indicate to start KMS, and agpmode=-1 (IMPORTANT!!) will start the driver in PCI Mode, and not in AGP Mode (which is the cause of black screen).You could add the two modprobe into a script, and execute it instead of typing all. Now, I started X, and glxinfo reported:

[danimoth@jim ~]$ glxinfo | grep vendor
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: DRI R300 Project

The OpenGL vendor string is OK !!!

So I started glxgears to see FPS, but X crashes:

[ 137.813] [mi] EQ overflowing. The server is probably stuck in an
infinite loop.
[ 137.813]
Backtrace:
[ 137.814] 0: /usr/bin/X (xorg_backtrace+0x58) [0x100582cc]
[ 137.814] 1: /usr/bin/X (mieqEnqueue+0x1c8) [0x1004e5d8]
[ 137.814] 2: /usr/bin/X (xf86PostButtonEventP+0xf4) [0x10061be8]
[ 137.814] 3: /usr/bin/X (xf86PostButtonEvent+0xb4) [0x10061d2c]
[ 137.814] 4: /usr/lib/xorg/modules/input/evdev_drv.so
(0xf380000+0x3d88) [0xf383d88]
[ 137.814] 5: /usr/bin/X (0x10000000+0x68784) [0x10068784]
[ 137.814] 6: /usr/bin/X (0x10000000+0x11a7e4) [0x1011a7e4]
[ 137.814] 7: (vdso) (__kernel_sigtramp32+0x0) [0x100344]
[ 137.814] 8: /usr/lib/xorg/modules/dri/r300_dri.so
(0xf3f5000+0x48534) [0xf43d534]
[ 137.814] 9: /usr/lib/libdrm.so.2 (drmIoctl+0x40) [0xf8b8f64]
[ 137.814] 10: /usr/lib/libdrm.so.2 (drmCommandWrite+0x24) [0xf8bbe60]
[ 137.814] 11: /usr/lib/xorg/modules/dri/r300_dri.so
(0xf3f5000+0x46944) [0xf43b944]
[ 137.814] 12: /usr/lib/xorg/modules/dri/r300_dri.so
(0xf3f5000+0x64d8c) [0xf459d8c]
[ 137.814] 13: /usr/lib/xorg/modules/extensions/libglx.so
(0xf930000+0x40f78) [0xf970f78]
[ 137.814] 14: /usr/lib/xorg/modules/extensions/libglx.so
(0xf930000+0x44be4) [0xf974be4]
[ 137.814] 15: /usr/bin/X (0x10000000+0x34a24) [0x10034a24]
[ 137.815] 16: /usr/bin/X (0x10000000+0x18bc4) [0x10018bc4]
[ 137.815] 17: /lib/libc.so.6 (0xfb39000+0x1f544) [0xfb58544]
[ 137.815] 18: /lib/libc.so.6 (0xfb39000+0x1f6d0) [0xfb586d0]

The only thing I've need to do is remove ALL xorg.conf.d/ files which contains some reference to the radeon module. Just let X.org to autodetect all things..

At next reboot, I was capable to do glxgears without crashing, with ~1500 FPS.
Coming back to 2.6.33.4, I could see which the permission fix resolved also my FPS here (without FPS): ~1500 !

I'm so happy now :)

Thanks to xorg-ati mailing list to help me with this (and primarily with apgmode=-1).

Tell me your stories.

Nessun commento: