Bug 36424

Summary: X crashes in KDE4 with compositing enabled
Product: xorg Reporter: Alex Schuster <wonko>
Component: Driver/RadeonAssignee: xf86-video-ati maintainers <xorg-driver-ati>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg log file
none
My xorg.conf, but without any special settings I think
none
dmesg
none
Xorg log
none
kernel config
none
dmesg
none
Xorg log
none
glxinfo none

Description Alex Schuster 2011-04-20 07:41:18 UTC
Created attachment 45863 [details]
Xorg log file

Since KDE 4.6.0, I see nasty artefacts with the radeon driver in most applications when scrolling. They are less severe when compositing is turned off, but there are not gone altogether, and I like the desktop effects. And I am running an outdated version of X (1.7.7) anyway (because I had trouble with newer versions), so reporting the bug probably makes no sense.

So I tried to upgrade again. But while it seems to work fine with normal window managers, a KDE4 session crashes after a few minutes, without any apparent reason. With compositing disabled, KDE4 is runnig fine, too. I tried xorg-server 1.10.0.902 and 1.9.5, the latter with and without KMS kernel option set, and the backtrace in Xorg.0.log looks quite the same. My X is built with gallium support, but I turn it off via the nomodeset boot parameter. If I do not do this, the boot process hangs when settings the text font, and I see my Grub boot splash image in wrong colors and distorted. Gallium used to work in 1.7.7, but then I had no text mode at all, and had to wait for X to start in order so see anything on the display. It was also slower.

My graphics adapter is an on-board Radeon HD 3200. I am running Gentoo Linux an amd64, with kernel 2.6.38-ck, xorg-server 1.9.5, xf86-video-ati 6.14.1. BTW, I have no idea how the version numbers 6.7.0 to 7.6 relate to my versions, so I left them unspecified.

My workaround is to use the fglrx driver. It is working, but I have memory problems when using it, and already had them in the past. Don't know what's going on, but my system starts swapping early, and after a day of KDE4 usage I have to log out and in again in order to free memory. So I would like to switch back to radeon.

I tried to get better debug output, recompiled Xorg-server and xf86-video-ati with debug information, and started X with gdb --command=cmdfile according to 
http://www.x.org/wiki/Development/Documentation/ServerDebugging . But then I only get a blank screen with a cursor blinking at the top left, and when I try to switch back to a text console (I have to use Alt-SysRq-R/K before), my display goes into suspend mode. I am back at the text terminal, but I am blind, and have to reboot. Any idea why this is, and what I could do about it? I know this effect from past experiences, when I switch the graphics drivers. Normally switching back to the text console works after Alt-SysRq-R, but only once. But since I changed to the radeon driver one year ago, this did not happen any more.

So, this problem forces me to not use the radeon driver and use fglrx instead, which also has problems. I hope this can be fixed. But I guess you really _need_ the debug output, huh?
Comment 1 Alex Deucher 2011-04-20 07:45:39 UTC
Is there a reason you are using ums?  Please try enabling kms.  Make sure you remove nomodeset or radeon.modeset=0 from your grub config or modprobe config.
Comment 2 Alex Schuster 2011-04-20 09:36:35 UTC
Created attachment 45868 [details]
My xorg.conf, but without any special settings I think

For completeness, my Xorg config file. But I don't think there's anything special in there.
Comment 3 Alex Schuster 2011-04-20 12:23:25 UTC
Whoops, I got it wrong. I thought the 'nomodeset' parameter was for turning off the gallium stuff, but it looks like it is for toggling KMS. So it made no sense at all to build a new kernel with KMS deactivated... 

Anyway, as I wrote, without 'nomodeset', my system does not even boot. In the early boot process, when udev starts, at the point when the font changes, my system hangs. I see my grub splash image, distorted and in wrong colors. I don't use a framebuffer console or any vga= parameter, just plain text mode.

I think.

Now I re-compiled the kernel, disabling ALL frame buffer stuff (VGA 16-color support was compiled in, others were modules, but not loaded), and tried again. Whoa! This time, I get a nice small font i did not ask for, and I see the boot messages. Until... X starts. When I switch back to the text console then, I see the boot screen just as it was before the font changed. It flickers a little, like if my hires console was overlayed by an old screenshot.

I set up some commands to stop KDM, modprobe -r fglrx, activate xorg direct rendering and restart X, with the radeon driver this time. Works. And it does not seem to crash!

Cool. CPU usage is lower than with fglrx, too. But the wobbly windows desktop effect is gone.

Oh, and quake3 is unplayable now because of very very low frame rates. This is bad, but I could somehow live with this, as long as my KDE desktop is usable again.

Thanks for setting me on the right track.

Um, is the missing wobbly windows desktop effect normal? And should I file a bug for quake3 being way too slow to play?
Comment 4 Alex Deucher 2011-04-20 12:26:15 UTC
Please attach your dmesg output and xorg log from the working kms case.  You'll have to remove fglrx completely (and re-install the relevant X libs) before you can use the open source driver since fglrx replaces some X libs with it's own copies.
Comment 5 Alex Schuster 2011-04-20 18:02:02 UTC
Created attachment 45895 [details]
dmesg
Comment 6 Alex Schuster 2011-04-20 18:03:07 UTC
Created attachment 45896 [details]
Xorg log
Comment 7 Alex Schuster 2011-04-20 18:27:36 UTC
I am pretty sure that on Gentoo the ATI driver does not replace system file, as everything installs in a sandbox there. There are commands to switch between xorg and ati opengl stuff, I guess that changes the files that the ATI installer would modify.

I rebooted, and CRASH! While opening one of my crypto volumes. Reboot. The fglrx kernel module was still being loaded, so I renamed it and rebooted again. CRASH! This time while loading the tun kernel module. (BUG: unable to handle kernel paging request at ...). I don't reboot often, about once a week, but I never had such crashes before. Weird.
I rebooted for a last time, and attached dmesg and Xorg log. There is this line in the log file:

  (II) RADEON(0): GPU accel disabled or not working, using shadowfb for KMS

GPU not working? This doesn't sound good. And dmesg has this:

  r600_cp: Failed to load firmware "radeon/R600_rlc.bin"
  [drm:r600_startup] *ERROR* Failed to load firmware!
  radeon 0000:01:05.0: disabling GPU acceleration

Hm. I have several R???_{cp,pfp,me}.bin files in /lib/firmware/radeon/, but no R600_rlc.bin. Any idea why?

I'll also attach my kernel .config, and then I stop for now, and continue investigating this tomorrow.
Comment 8 Alex Schuster 2011-04-20 18:28:23 UTC
Created attachment 45901 [details]
kernel config
Comment 9 Alex Deucher 2011-04-20 19:25:10 UTC
(In reply to comment #7)
> I am pretty sure that on Gentoo the ATI driver does not replace system file, as
> everything installs in a sandbox there. There are commands to switch between
> xorg and ati opengl stuff, I guess that changes the files that the ATI
> installer would modify.
> 

Seems doubtful.  Try removing fglrx completely and reinstalling the xserver just in case.

> GPU not working? This doesn't sound good. And dmesg has this:
> 
>   r600_cp: Failed to load firmware "radeon/R600_rlc.bin"
>   [drm:r600_startup] *ERROR* Failed to load firmware!
>   radeon 0000:01:05.0: disabling GPU acceleration
> 
> Hm. I have several R???_{cp,pfp,me}.bin files in /lib/firmware/radeon/, but no
> R600_rlc.bin. Any idea why?

If you are using an initrd, you need to include the firmware files in the initrd.  If you build the radeon module into your kernel, you have to built the firmware into your kernel as well.  See this page for more info:
http://wiki.x.org/wiki/radeonBuildHowTo#Missingfirmware
Comment 10 Felix Blanke 2011-04-20 23:53:48 UTC
1) You really should remove fglrx. I had such a problem with the nvidia and nouveau driver. I'm also using gentoo, and I'm pretty sure that there where some kind of conflicts.

2) You have to install the firmware x11-drivers/radeon-ucode
Comment 11 Alex Schuster 2011-04-21 08:59:27 UTC
Okay guys, thanks for the comments. I removed all of the fglrx stuff, installed radeon-ucode (thanks, Felix!) and built another kernel, setting CONFIG_EXTRA_FIRMWARE="radeon/R600_rlc.bin" and CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware". Desktop effects are all back! No apparent errors in dmesg or Xorg log. X takes less CPU power than with the fglrx driver. Cool!

The only problem now is that OpenGL still is slow sometimes. glxgears tells me the framerate should be approximately my refresh rate, but I would expect 60 instead of around 40 FPS. When I enlarge the glxgears window, the frame rate drops down to about 20 FPS. 

When I turn compositing off, I get 55 FPS, and around 30 in full size.

Quake3 is still slow though. Unplayable (15-20 FPS) with compositing on, and without compositing, a little faster, but flickering.
Comment 12 Alex Schuster 2011-04-21 09:00:22 UTC
Created attachment 45923 [details]
dmesg
Comment 13 Alex Schuster 2011-04-21 09:01:19 UTC
Created attachment 45924 [details]
Xorg log
Comment 14 Alex Schuster 2011-04-22 04:11:21 UTC
Just one addition: I finally upgraded xorg-server from 1.9.5 to 1.10.1. No changes, I think. I tried glxgears in another window manager (enligtenment 0.16), the frame rate is around the 60 Hz of my TFT now as it should. Unless I make the window very large, then it drops. Quake3 runs slow, with heavy flickering.

As it does in KDE 4.6 with compositing disabled. glxgears then gives 53-58 FPS, and 30 when full size. With compositing enabled, it's 30-35 FPS, and 20 FPS when full size. Quake3 is very slow, and the mouse cursor lags bedind my movements.

Apart from this, all is great. But I would really like to be able to play my beloved Quake3 again soon.

All this no longer has anything to do with "X crashing in KDE4 with compositing enabled". Should this bug be closed, or are crashes when not using KMS still relevant? If necessary, I could downgrade again and try to reproduce this in order to get debug information, but that would be some work, and I did not succeed at all trying to use gdb.

Should I file a new bug with my current OpenGL acceleration problems? Or should I better rename this one?
Comment 15 Alex Deucher 2011-04-22 08:23:05 UTC
Can you attach the output of glxinfo?
Comment 16 Alex Schuster 2011-04-23 09:36:29 UTC
Created attachment 45993 [details]
glxinfo

Here it is.
Comment 17 Adam Jackson 2018-06-12 19:08:35 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.