# X freezes when shutting down with ati-drivers [SOLVED]

## selig

I am having this problem on several computers and several graphics cards.

One of them is a P4 with a Radeon 9800 PRO, another one is an AMD64x2 with Radeon X1650 XT (if I remember correctly) and finally an AMD64 with Radeon X1650 PRO.

Tried the latest stable ati-drivers, and the latest available in portage (8.501), no luck. Whether I use startx, KDM, GDM, it is still the same. X freeze when I log out. If I log in from another computer, I can see that X is eating up all of the CPU. The system can be rebooted normally by using ctrl+alt+del or by logging in remotely and issuing a reboot command.

The systems are fully updated, xorg, everything... having to reboot instead of logging out is very annoying.

My setup looks like this:

```

Section "Device"

    Identifier "device1"

    VendorName "ATI"

    BoardName "Sapphire Radeon 9600 XT"

    Driver "fglrx"

    Option "DPMS"

    Option "mtrr" "off"

    Option "NoTV" "yes"

    Option "VideoOverlay" "on"

    Option "OpenGLOverlay" "off"

    Option "Stereo" "off"

    Option "StereoSyncEnable" "1"

    Option "FSAAEnable" "yes"

    Option "FSAAScale" "2"

    Option "FSAADisableGamma" "no"

    Option "UseFastTLS" "0"

    Option "UseInternalAGPGART" "no"

    Option "ForceGenericCPU" "no"

    Option "BlockSignalsOnLock" "on"

    BusID "PCI:1:0:0"

    Screen 0

EndSection

```

I can see no errors in the Xorg log.

Thanks for any suggestions!Last edited by selig on Fri Sep 19, 2008 9:07 pm; edited 4 times in total

----------

## cn

Not sure if its the exact same problem.

But I had something like it. This one solved it for me.

http://www.gentoo-wiki.com/ATI_drivers#System_freezes_after_logout_with_GDM_or_KDM

----------

## DirtyHairy

You might want to try to rip out the configuration from your xorg.conf and create a new one via 

```
aticonfig --initial
```

 People used to play around with xorg.conf options alot with the older versions of the drivers to tweak them to run properly, but the newer ones actually seem to work much better with the vanilla settings (which is practically none besides "Driver = "fglrx""  :Smile:  ). For example, "VideoOverlay = "on"" does not work and may even cause problems on newer hardware (R500+) as these chips don't have a dedicated video overlay engine anymore but use 3D textures to achieve the same effect.

P.S.: Also, for some time now fglrx has been using an additional database to manage its settings (which also stores user settings in the catalyst control center) which overrides settings in xorg.conf. This database is located in /etc/ati/amdpcsdb , so, if cleaning your xorg.conf settings don't work, you might also want to replace this file with /etc/ati/amdpcsdb.default, completely delete it (should have the same effect) or even to completely unmerge and remerge the driver to make sure it really is in the state intended by ATI.Last edited by DirtyHairy on Sun Aug 17, 2008 11:40 am; edited 1 time in total

----------

## selig

 *DirtyHairy wrote:*   

> You might want to try to rip out the configuration from your xorg.conf and create a new one
> 
> For example, "VideoOverlay = "on"" does not work and may even cause problems on newer hardware (R500+) as these chips don't have a dedicated video overlay engine anymore but use 3D textures to achieve the same effect.

 

Really, I removed all of the options and now it behaves fine!  :Very Happy:  I also noticed that the video overlay was not working and it fixed it too, just like you explained. I will do it on the other two boxes too. Thanks a lot!

----------

## DirtyHairy

You're welcome  :Smile: 

----------

## selig

It seems that there is still some problem which occasionally causes X to freeze when logging out... so far the main suspect is xscreensaver but I am not sure of that yet. When I just log-in and then log-out, it's all OK. But when the screensaver activates, X freezes while logging out. I am not 100% sure yet that it is the cause though, I have to do more testing. Killing xscreensaver before logging out does not help. In case it is really the culprit, I will just switch to xlock.

----------

## DirtyHairy

You might also try 8.493; I too had some problems with display corruption and occasional lockups related to xscreensaver with 8.501 (and its successor).

----------

## selig

I've tried this version and it fixes some issues with OpenGL xscreensaver stuck on exit (which has to be killed). I don't know if it fixes the problem with exiting X yet... I've tried shutting down the system from Gnome once and X exited shortly before powering off - probably after getting the SIGKILL. They are killable by kill -9 but gdm doesn't seem to use SIGKILL but rather SIGTERM to "kill" them.

I basically need X to get killed by SIGKILL on session exit... it would be a reasonable workaround.

----------

## selig

The X process which is consuming 100% CPU is not even killable with the older driver version.

Are you using the "xcb" USE flag or not? I've got it on and it's the only thing that comes to my mind which could affect the behaviour of ati-drivers.

----------

## DirtyHairy

"xcb"? Never heard of it and can't find it  :Smile:  Sorry, I'm at a loss here. Exiting to gdm works fine for me, but I don't think it restarts X on my machine (at last I didn't configure it to do so). When I shut down /etc/init.d/gdm, usually X hangs though consuming 100% CPU and has to be send  SIGKILL to terminate.

----------

## selig

Hmm.. so you're facing the same problem. I don't know if GDM can be told not to restart the X server - there is only an option "AlwaysRestartServer" and if it's not set I guess it does not *always* restart the server (probably just "sometimes"  :Laughing:  ) I'd need a "NeverRestartServer" option... When I'm using the session for a shorter period of time, it apparently doesn't restart the X server and I can log out nicely. But after a longer time it restarts the X server and I have to reboot.  :Sad: 

To see if you're using xcb just try "emerge -pv libX11" for example. Mine gives an output like:

```

emerge -pv libX11

These are the packages that would be merged, in order:

Calculating dependencies   ... done!           

[ebuild   R   ] x11-libs/libX11-1.1.4  USE="xcb -debug -ipv6"

```

----------

## DirtyHairy

```
pestix@gondolin ~ $ eix libX11

[I] x11-libs/libX11

     Available versions:  1.1.2-r1 1.1.3 ~1.1.3-r1 1.1.4 {debug ipv6 xcb}

     Installed versions:  1.1.4(15:15:21 03.06.2008)(ipv6 -debug -xcb)

     Homepage:            http://xorg.freedesktop.org/

     Description:         X.Org X11 library
```

You could also try one of the other login managers like kdm, entrance or xdm and see if it behaves better and doesn't restart X.

----------

## selig

So it looks like you are not using xcb... I might try disabling it and we will see. X freezes even when I am not using any login manager at all, only "startx".

----------

## DirtyHairy

Allthough, if restarting X crashes Xorg, then it is not surprising that startx does also as the xserver dies on logging out this way  :Wink: 

----------

## selig

The problem is that the X server doesn't really want to die!  :Very Happy:  I'll try recompiling everything without xcb tomorrow and we'll see. I've installed a new CPU which should speed up the process.   :Wink: 

----------

## bunder

xorg and fglrx have always been known to cause hassles, even till this day.  have you happened to try xf86-video-ati?  it seems to be getting better than fglrx, but imo, nothing beats an nvidia card.   :Confused: 

cheers

----------

## selig

I have not tried it with Radeon X1650 but from what I remember from Radeon 9200 and 9600 the performance was quite poor and a lot of features was probably missing because Unreal Tournament 2004 for example definitely did not look the way it should. (missing textures, weird artifacts etc.) I tried Radeon 9200 with the latest stable Xorg in portage about a month ago. Even the 2D performance is really not what I would expect (having to wait about half a second while switching desktops is cranky).

----------

## selig

Unfortunately, recompiling things with "-xcb" did not help. I guess you are not facing these issues with ati-drivers? Could you share your emerge--info, xorg.conf, ati-drivers version and maybe even kernel config?

I am using the in-kernel agpgart driver - or is it better to use the one included in ati-drivers?

----------

## bunder

 *selig wrote:*   

> Unfortunately, recompiling things with "-xcb" did not help. I guess you are not facing these issues with ati-drivers? Could you share your emerge--info, xorg.conf, ati-drivers version and maybe even kernel config?
> 
> I am using the in-kernel agpgart driver - or is it better to use the one included in ati-drivers?

 

i switched to xf86-video-ati.  sorry, can't really help.   :Embarassed: 

most of my config stuff came from here though: http://www.audido.com/9200/  not sure if that'll help at all.   :Confused: 

----------

## selig

SOLVED! You would not have guessed what the problem was... I was stupid and issued "rc-update add atieventsd default" on all systems - and of course, atieventsd causes the problems!   :Rolling Eyes:  why do they even ship it with the ati-drivers package if it just makes the X freeze on logout?

----------

