Running swsusp2 with nvidia

Kernel 2.6

This little info page should describe how I got swsusp2 to work with my Nvidia card and the latests Nvidia drivers. Today (10-11-2005) I have upgraded my System to SuSE 10.0, working with a (more or less) vanilla kernel 2.6.14.1 and Software Suspend2 2.2-rc9. Im running Xorg 6.8.2.

If you find your setup also supported by this, feel free to add it.

Hardware

My Nvidia card in my Toshiba Satellite 2430-201 :

~/ # lspci | grep GeForce
0000:01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 420 Go] (rev a3)

Also reported to work with: // Not yet with 2.6.12+2.1.9.5, please verify again

* Geforce 2 Go on Dell 4100 Inspiron

* GeForce2 Go on Compaq TC1000 (gentoo, suspend2-sources-2.6.19-r2, nvidia-legacy-drivers-1.0.7184, Xorg 7.2.0)

* Geforce FX Go5600 on Sony Vaio

* GeForce 4 420 Go on Jewel Opal 4002

* GeForce4 MX on a desktop with a Winfast K7NCRG-PRO II board

* GeForce FX 5600 on a P4 - Hyper Threading Desktop PC (i865PE chipset) (kernel 2.6.14.5, suspend 2.2-rc14)

* GeForce FX Go5700 on an HP zd7260us laptop (debian, kernel 2.6.12, swsusp2 2.1.9.9, nvidia 7667, Xorg 6.8.2)

* GeForce Go 6600 (kernel 2.6.14, swsusp 2.2-rc14, nvidia 8174 + ACPI patch from nvnews.net)

* GeForce 6600 GT, kernel 2.6.17.8 swsusp 2.2.7-for-2.6.17, nvidia 8762 + all patches prepackaged by default with debian linux kernel 2.6.17. Not tested with framebuffer.

ACPI

It also works fine with the shipped ACPI DSDT, but I always recommend to replace it. My own version now also supports thermal zone and fan monitoring. This has nothing directly to do with software suspend support.

I have patched my kernel with the latest acpi patches. I also recommend to apply those patches, althought it *might* work without. It depends on how good ur current acpi support is for your hardware. From my experiences, on most systems it works well with the 2.6.14.z acpi.

Kernel

Running a vanilla 2.6.14.1 with the above patches applied. Very important for me is that agpgart support is not enabled, neither compiled in nor as a module. The new nvidia framebuffer support is also disabled for me, since it does not work, but it would be nice if anyone could post a comment if it works for him with this new framebuffer.

Software Suspend 2

I have downloaded the software-suspend-2.2-rc9-for-2.6.14.tar.bz2 patch packet, applied the patches with the supplied apply script, and all went happy.

I have disabled APM support and enable all ACPI supports, compiled directly into the Kernel. You should not have the Regparm or the 4kStack option on in the Kernel, with both it did not work for me (already swsusp2 without nvivida). Important for the new Setup is (if you want to use compression) a proper compression module from the cryptoapi, I have compiled deflate and lzf in, so I dont have to fiddle with the initrd

XF86Config / xorg.conf

I have no special options set here, since I have disabled agpgart in the kernel. According to the Nvidia drivers readme you can set the NvAgp option :

Option "NvAgp" "0" ... disables AGP support
Option "NvAgp" "1" ... use NVAGP, if possible
Option "NvAgp" "2" ... use AGPGART, if possible
Option "NvAGP" "3" ... try AGPGART; if that fails, try NVAGP

So you can see that you might disable agpgart support with setting it to 1 (using nvidia agp) or totally disable it by setting it to 0. This does not seem to be needed. On my System it works with agpgart support disabled in the kernel, so probably setting it to 1 should work too.

I have to set "RenderAccel" to "false" on my system to get KDE 3.4 to startup properly, but with other windowmanagers it works fine. I have problems with Composite extensions enabled, you might have to play with settings.

Nvidia Driver

Using Version 1.0-7676 from nvidia.com. You may not use RegParam option in kernel, and you need a little patch again.

As line 3627 in nv.c add

case PM_SUSPEND_STANDBY:

Otherwise the standby fails here.

Version 1.0.7174 also works fine for me (vatachino) and supports 4k stacks and other ##newer kernel options. Please re-verify

Version 1.0.7667 also works, at least for me (mwiertz), the patch has to be inserted on line 3629 of nv.c, works with kernel 2.6.12.

Inserting the patch after line 3626 (just as first point in the switch environment) seems to be a better choice and worked for me (tuxmas).

Version 1.0.7676 needs this patch at line 3667.

Version 1.0.7667 works for me (tmarble, see hp7260us above). For a unified diff (much better than line numbers) and a specific bug report for debian please see bug #303800. NOTE: I did NOT disable agp in the kernel config.

Version 1.0.8174 works for me (Asus z71v laptop) with the ACPI support update from http://www.nvnews.net/vbulletin/showthread.php?t=61052 and kernel 2.6.14 No more console switch bugs or lagging either for once. UPDATE: I got suspend-to-mem to work once too, sorta. Suspend-to-mem right after a resuming from suspend-to-disk works fine. Suspend-to-mem right after booting up causes the display to remain black after resume. In either case, the system shuts down after resume. In the former, I see the "System is about to be halted..." broadcast and then fbsplash pops up with the shutdown progress screen. I think there's a faulty powerbutton press popping up somewhere.

Version 1.0.8178 works for me with the ACPI support update from http://www.nvnews.net/vbulletin/showthread.php?t=62021 (the small patch mentioned above is not needed any more) and kernel 2.6.14.5. The console trashing bug is gone when setting the framebuffer mode the same resolution and colours as in the X setup (for me running 1280x1024@32 bit, I need to use 0x31B in Grub or Lilo)

Version 1.0.8756 worked for me immediatelly after running Nvidia installation program. It just replaced old patched 1.0.8178 driver and worked. No patching needed. Problems with textconsole mode disappeared with this driver - text consoles are simply working after resume from disk.

My configuration: HW: Asus A6VM

Graphics card: nVidia GeForce Go 7300 TurboCache 256MB, PCIe,

Linux: Mandriva 10.0 Kernel: Vanilla 2.6.15-rc6 SwSusp version: suspend2-2.2-rc14-for-2.6.15-rc5

Confirmed: nvidia driver 1.0.8756 with suspend2 patched vanilla kernel 2.6.16.9 works out of the box with no further patching needed. What I did:
1. Downloaded vanilla 2.6.16.9 kernel, patched it with swsusp2
2. Tried it... didn't work (hang)
3. Further reading led me to do the following three things: I am unsure of what combination of them (perhaps only one) is necessary to insure success.
(1). Disabled internal agpgart support in linux (it's under character devices in 'make xconfig') and recompiled/installed the kernel.
(2). Set Option "NvAGP" "1" in xorg.conf for nvidia driver.
(3). Added "ProcSetting extra_pages_allowance 0" to hibernate.conf as addressed in nvidia's readme. (I think this one is definitely necessary)

After this, everything works like a charm. My system: SMP Dual-core Athlon64, Geforce 7600GT. Oh, and you probably also want to remove 'nvidia' from the blacklisted driver list in /etc/hibernate/blacklisted-modules.

I (marcoS) can confirm this, exactly the same for me (2.6.17-rc3 with suspend2-2.2.5-for-2.6.17-rc2 and Nvidia 8756 without other extra patches, on gentoo complete amd64 system with a ti4400 in TwinView). First it hung, followed the above steps, now works perfect, except that I did not have to follow step (1.). Step (2.) did completly cover this issue. Step (3.) was necessary too !

hibernate.conf

I'm using the hibernate script 1.12, not only because its so nice and shuts down my network interfaces and umounts my nfs drives. Starting a dummy X Server does not seem to be needed any more, though u might need it on your system, play with it.

Note that suspending and resuming the Nvidia drivers blanks the text mode screen. So both on suspend (just before it powers off) and on resume the computer appears to have died. This is especially worrying the first time you resume, as it can take several minutes between starting to resume and the screen coming back on (it goes completely black!). So if this happens to you, be patient. It may well be working OK behind the scenes. On my system, using the VESA Framebuffer, resume also trashed the framebuffer completely, but X works fine. Now I have found a solution. I had set 0x317 Video mode in my lilo.conf (1024x768x16) and changed it to the same that X runs as (1024x768x24) which is 0x318 . --PlasmaHH

My framebuffer, and even my normal console, trashes too, have been playing around with vbetool, but without succes... (so please, if you know how to fix, let me (mwiertz) and the rest of the world know...) Maybe the above fixes your problem too?

Here we go: I (tuxmas) added the following lines to the /etc/hibernate/hibernate.conf

FBSplash on
FBSplashTheme suspend2

and

SwitchToTextMode yes
UseDummyXServer yes

Furthermore I uncommented the nvidia module in /etc/hibernate/blacklisted-modules and activated NvAgp in /etc/X11/XF86Config-4

Driver "nvidia"
Option "NvAgp" "1"

in the "Device" section. Hibernation works fine now! When resuming the screen goes blank again, don't worry. It takes only few seconds because the hibernate script is still not finished (you can watch this by an open ssh session while resuming). After the script ends the framebuffer is restored and everything is fine.

I don't know if the xhacks or the fbsplash mode solved the problem. (tuxmas)

Notes

I need to use deflate, and it takes ages to suspend. LZF seems faster, but ultimately crashes, so I look forward to other compressors.

(geronime - feb 18 2007): Adding next supported combination of hardware/software: Finally I made this work on my Compaq TC1000 tablet with nVidia GeForce2 Go (16MB) PCI (NOT AGP card):
I use gentoo with suspend2-sources version of kernel, 2.6.19-r2 actually. The agpgart as disabled, also I disabled APIC functions in processor section but not sure if necessary. GeForce2 Go requires x11-drivers/nvidia-legacy-drivers (1.0.7184 current version) since this GPU is no longer supported by nvidia-drivers ebuild.

xorg.conf:

Option      "NvAGP"   "0"

hibernate.conf (important lines):

UseSuspend2 yes
PowerdownMethod 5
ProcSetting full_pageset2 1
  # not sure if necessary, may be problems without it
  # there are some issues with new kernels (2.6.18/2.6.19)
ProcSetting extra_pages_allowance 0
  # nVidia recommended option
UnloadBlacklistedModules yes
LoadModules auto
GentooModulesAutoload yes
SwitchToTextMode no
UseDummyXServer no

Also, I commented out the "nvidia" line in blacklisted modules.
Result: working suspend to swap from fvwm, the computer hangs a while in black screen before powered off (with nv driver I used before I was able to see something like "powering down" message). I do not use framebuffer, the consoles are working but cursor disappears after first resume. The system is utf8 native, maybe it has something to be done with the consoles and disappearing cursor.

None: DistroAndHardwareSetup/Nvidia (last modified 2007-07-02 06:29:13)