Friday, March 02, 2007

ATI driver and suspend-to-ram


It appears that a lot of people (running openSUSE 10.2) are having issues with the last releases of the proprietary ATI fglrx Linux driver in combination with suspend to RAM. Especially version 8.33.6 but also 8.32.5 seem to hang up the system in most cases.

At Moosy we wanted our beloved suspend function back and started to investigate. We found this document at AMD which simply stated: "ATI Engineering is aware of this issue and is investigating." Not very promising.

When digging deeper into this, we found a solution that may work for you. This has been tested on some Dell Latitude and IBM Thinkpad laptops and has been found to work on those. YMMV.

openSUSE powermanagement
openSUSE works with s2ram and pm-utils as a framework for suspending. See the s2ram page on the openSUSE site.
S2ram does the actual suspending and comes with several options for different machines. Pm-utils runs distro-specific scripts for preparing the system for suspend (unloading modules, etc.)

We found that adding some options to s2ram and removing some SUSE scripts from pm-utils resulted in working suspend-to-ram with the latest fglrx drivers.

Start: s2ram
First see if you can get your machine to suspend using s2ram. To do this, open a terminal and become root. Type
s2ram
and hope for the best. The command comes with several options and the one that does the trick for ATI cards seems to be -m which saves and sets the VBE mode. We found that on Dell machines, the following combination works:
s2ram -f -m

while on IBM machines
s2ram -f -s -m or even s2ram -f -s -m -a 3
was necessary. Experiment some, but keep the -m option. You may want to check the s2ram suggestions for you machine using
s2ram -n
and checking the line starting with "Fixes".

Add s2ram options to your setup
The options that work for you need to be put into the suspend configuration. To do this, open the file /etc/pm/config as root and search for S2RAM_OPTS="". Add the options that you needed to add for your machine here, preceded by a space, like this:
S2RAM_OPTS=" -f -m"


Remove pm-utils scripts
Now the not-so-funny part: we discovered that after this, suspending still did not work! It turned out that some of the scripts that are run by pm-utils cause this. The scripts are located in /etc/pm/hooks and we needed to remove at least the cpufreq and videobios scripts. So, to do this enter
cd /etc/pm/hooks
and do a
rm 80videobios 94cpufreq 99Zgrub

(the last one may not be necessary). Please note that removing these scripts may break things (like suspend to disk).

After this, reboot to ensure that the changes are picked up by the powermanagement system. If this worked for you, let us know!! We tested on Dell D810, D600 and IBM t43, t60p systems.

1 comment:

Anonymous said...

thanks to your explanations and http://en.opensuse.org/S2ram, I could fix s2ram problem for resume after a few hours...

I don't know how to add my computer to the white list ; my computer is documented with nvidia graphic card but I have ATI graphic card and options are not explained...

It works with :
vga=0 option in grub
s2ram -f -m

Everything seems to work fine yet : usb ok, wifi ok (I only have to click on Knetworkmanager icon to connect afer resume).




Machine matched entry 51:
sys_vendor = 'Dell Computer Corporation'
sys_product = 'Inspiron 8500 *'
sys_version = ''
bios_version = ''
Fixes: 0xc VBE_SAVE VBE_POST
This machine can be identified by:
sys_vendor = "Dell Computer Corporation"
sys_product = "Inspiron 8500 "
sys_version = ""
bios_version = "A03"
ATI graphic card :
vga=0 option in grub
s2ram -f -m

See http://en.opensuse.org/S2ram for details.