The nvidia kernel driver as-is currently doesn't work with software suspend (as used in sys-kernel/suspend2-sources). I found the solution to this problem in a link at the software suspend 2 howto at the wiki (http://gentoo-wiki.com/HOWTO_Software_Suspend_v2), so I don't know why it hasn't been reported here in the bugzilla yet (at least I couldn't find any dupes -- bug 67574 is something else). The link leads to http://wiki.suspend2.net/DistroAndHardwareSetup/Nvidia, which describes the patch needed to nv.c. I did this and tested it with nvidia-kernel 1.0.7667, and it worked great (lucky the line numbers were identical..). I'll attach a patch. Reproducible: Always Steps to Reproduce: 1. Remove nvidia from /etc/hibernate/blacklisted-modules 2. hibernate Actual Results: System hangs on resume (without the patch). Expected Results: Resume =). With the patch, this works perfectly.
Created attachment 63298 [details, diff] nvidia-kernel-swsusp-fix.patch This patch was made using nvidia-kernel 1.0.7667, but it should work with 1.0.7664 and possibly some older versions as well.
This patch can probably be easily included into the main nvidia-kernel ebuild by simply doing something like the following: src_unpack() { ... if kernel = suspend2 ; then einfo "Applying patch for Suspend2" epatch ${NV_PATCH_PREFIX//7167}-nv.patch fi ... } The function "if" should check to see if /usr/src/linux-2.6.12-suspend2* sources are being used. If so, patch with the above patch. (I think nvidia-kernel 1.0.7667 needs an updated patch - I noticed the offset is quite a bit on the newer version of nv.c) (This patch is going to be quite popular with laptop users because it actually works now!)
Here's something that should work: # My patch to make nvidia play nice with SWSUSP2 if [ ${KV_EXTRA} = "-suspend2-r3" ] ; then einfo "Applying patch for Suspend2" epatch ${NV_PATCH_PREFIX//7167}-nv.patch else einfo "NOT applying patch for Suspend2" fi (Customize as needed :-) To create this patch: # ebuild /usr/local/portage/media-video/nvidia-kernel/nvidia-kernel-1.0.7667.ebuild digest # ebuild /usr/local/portage/media-video/nvidia-kernel/nvidia-kernel-1.0.7667.ebuild unpack # cd /var/tmp/portage/nvidia-kernel-1.0.7667/work/NVIDIA-Linux-x86-1.0-7667-pkg0/usr/src src # /usr/bin/diff -uprN nv/nv.c nv/nv.c.new > /usr/local/portage/media-video/nvidia-kernel/files/1.0.7667/NVIDIA_kernel-1.0-7667-nv.patch
Ok. Tested several times here and suspending X with nvidia works now. Almost forgot, before applying this patch in the ebuild, we should check for AGP not being set! Do something like this: pkg_setup() { CONFIG_CHECK="!AGP" } (I've yet to test this bit of scripting. I've also seen this test function simply in the head of the ebuild with all the rest of the variables. As I collect notes here, and if nobody gets around to completing this stuff, I'll eventually gather enough info to attach a complete ebuild. :-)
CONFIG_CHECK="!AGP" only seems to be working within the top (variable definitions) of the ebuild. When I try to stick the CONFIG_CHECK within the if/then KV_EXTRA check, it doesn't work.
Did anyone made a upstream bug-report? Like writing a mail to linux-bugs@nvidia.com? If not, I'll do so after I confirmed it working. But this might take a while, 'cause I'm very busy.
I just installed gentoo's suspend2 and latest nvidia driver 8178 for my nv 6600. The driver's ebuild contains the required patches to make it work. Still if using NVidia driver's AGPGART I am unable to resume as it freezes. With kernel's AGPGART its working fine (except my vga console is garbled on resume) X is usable. (Still I have to use driver's internal AGPGART because kernel's AGPGART is not stabile and is too slow compared to internal.) So anyone else got a solution? Mobo: ABIT NF7 AMD 2500+ kernel 2.6.15-suspend2-r4 msi nx6600 + nvidia driver 8178 installed with latest ebuild.
Typical of Nvidia's driver? I haven't used suspend for quite some time since I've created this ebuild. I might dable with the suspend with my Geforce2 Mobile when I get some free time to see how things have progressed.
I've tried it with my new Nvidia 6800. The same result. Using NVagp freezes the system.
( Sorry. Eek. Looks like Gerry created this one. :-/ )
Just tried Suspend2 with my laptop. I believe I'm using sys-kernel/suspend2-sources-2.6.15-r8 and $ fgrep /usr/portage/media-video/nvidia-kernel -r -e "PM_SUSPEND_STANDBY" still shows this patch has yet to be integrated. I've personnally tried Suspend2 on my laptop and all works flawlessly. I can even disable AGP with the nvidia module still loaded (un-blacklist nvidia) and be able to easily stop xdm before suspend without almost any problems. However, if I try suspending while xdm is started, suspend2 hangs just prior to turning off. I'm guessing this is because this patch is not integrated yet? Well, I'm off shortly to manually hack this piece of code into the ebuild within my /usr/local/portage. I'll report back with my results.
Rumor has it, this patch is no longer needed with nvidia-kernel version 8178. (From what I see too, nv.c SUSPEND functions have been rewritten.) noapic might or might not be needed w/i lilo.conf / grub.conf
(In reply to comment #12) > Rumor has it, this patch is no longer needed with nvidia-kernel version 8178. Closing an obsolete bug, the patch is irrelevant for uptodate nvidia-drivers (>=1.0.8756 per suspend2 wiki).