Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nvidia and software suspend 2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Maranza
n00b
n00b


Joined: 25 Jun 2004
Posts: 34

PostPosted: Wed Jan 19, 2005 11:36 am    Post subject: Nvidia and software suspend 2 Reply with quote

I'm trying to make this software suspend thing work, it looks very interesting. basically it's working: if i kill x and unload the nvidia and emu10k1 modules manually, resuming works and i can load them back into a fully working operating system. But i wouldn't get much of a speed increase by leaving X out of the suspension/resume cycle. Also X is loaded through xdm (kdm really, but here in gentoo the xdm service handles all), and the hibernate script can't shut it down properly: if i put xdm as a service to restart in hibernate.conf and blacklist the nvidia kernel module, on resuming it freezes on the nvidia logo. Anyone had a similar problem? Anyway, i've found a few solutions for the problem:
1. the case PM_SET_WAKEUP: hack looks very dirty to me. according to the wiki, it has to be inserted after line 3677 in nv.c, but i'm splitting up a function declaration here! i tried anyway, but i've got syntax errors of course.
2. i found another patch on the forums that might work.. but this one requires NvAgp to be set to 0, which means disabling agp support. I don't play 3d games, i think the most agp-aware application that i run is xcompmgr.. will i experience slowdowns without agp?

Running a 2.6.10 kernel with the 2.1.5.14 swsusp2 patch
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Wed Jan 19, 2005 12:55 pm    Post subject: Reply with quote

I'm currently using swsup2 with nvidia (with X and composite enabled).
Answers are in the swsup FAQ Section 4 Compatibility issues (parts 6 & 7) : http://softwaresuspend.berlios.de/FAQ-4.html#ss4.6.

To make it works, you have to use nvagp (nvidia agp support) by disabling agpgart in your kernel config.
Don't forget to re-emerge nvidia-kernel once you have your new kernel compiled.
After reboot, you've got to have something like this :
Code:
cat /proc/driver/nvidia/agp/status
Status:          Enabled
Driver:          NVIDIA  <--- LOOK HERE (it's not agpgart)

With this, swsup may works (comment nvidia in the hibernate blacklist file : "/etc/hibernate/blacklisted-modules").
Maybe you have to disable FW and SBA in your "/etc/modules.d/nvidia" (don't forget to run "modules-update" after that modification). My Xorg locks if I let them on. :(

The emu10k1 modules seems to be blacklisted too. You can try to comment the line in "blacklisted-modules" file and check if it works.
If it doesn't, uncomment the line and add in the "/etc/hibernate/hibernate.conf" file something like :
Code:
UnloadModules emu10k1
If emu10k1 is in your "/etc/modules.autoload.D/kernel-2.6" uncomment line "GentooModulesAutoload yes"; the emu10k1 will be load on reboot.
If it is loaded by alsasound rc-script you can add
Code:
RestartServices alsasound
in "/etc/hibernate/hibernate.conf".

Hope this helps !

EDIT : Imho you may disable xdm on startup ("rc-update del xdm") for testing nvidia changes (a little "startx" is sufficient to check if your config is OK).
EDIT2 : Don't forget to edit your xorg.conf to change the "NvAGP" option (device section). Put it to "3" will be a good solution (try to use agpgart if present then use nvagp; with that you can have different kernel config without X problems).
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
Maranza
n00b
n00b


Joined: 25 Jun 2004
Posts: 34

PostPosted: Wed Jan 19, 2005 5:45 pm    Post subject: Reply with quote

ok, i've cut off the agpgart support from the kernel and added nvagp... it's working nicely :)
i've still got a couple of problems tough:
1. is the image invalidated after each resume? i mean, can i safely try to resume an image even if i haven't suspended last time (swsusp2 will then skip resuming)?
2. the console is blank, would help using a framebuffer console?
3. after a few seconds, the video output goes crazy: the video is shifted of about 40% the lenght of my monitor. The part that would go out of the screen appears on the other side of the screen. Switching to the (blank) console and back to X solves the problem, but it's annoying nonetheless..
anyway, thank you :-)
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Thu Jan 20, 2005 9:09 am    Post subject: Reply with quote

Maranza wrote:
ok, i've cut off the agpgart support from the kernel and added nvagp... it's working nicely :)
8)

Maranza wrote:
i've still got a couple of problems tough:
1. is the image invalidated after each resume? i mean, can i safely try to resume an image even if i haven't suspended last time (swsusp2 will then skip resuming)?
I'm not sure but I think it's possible if the image is still saved. Check in hibernate config files. And of course in swsusp FAQ.

Maranza wrote:
2. the console is blank, would help using a framebuffer console?
3. after a few seconds, the video output goes crazy: the video is shifted of about 40% the lenght of my monitor. The part that would go out of the screen appears on the other side of the screen. Switching to the (blank) console and back to X solves the problem, but it's annoying nonetheless..
I don't have these problems here; so sorry to rtfm :roll: :
- FAQ : http://softwaresuspend.berlios.de/FAQ.html
- bootsplash : http://softwaresuspend.berlios.de/options.html
- gentoo wiki : http://gentoo-wiki.com/HOWTO_Software_Suspend_v2
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
Maranza
n00b
n00b


Joined: 25 Jun 2004
Posts: 34

PostPosted: Thu Jan 20, 2005 12:29 pm    Post subject: Reply with quote

Quote:
I'm not sure but I think it's possible if the image is still saved. Check in hibernate config files. And of course in swsusp FAQ

If you don't know that, how do you use swsusp2 on a regular basis? do you pass noresume2 (ore resume2=swap:/dev/hdx) to the kernel at every boot?
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Thu Jan 20, 2005 12:43 pm    Post subject: Reply with quote

Maranza wrote:
If you don't know that, how do you use swsusp2 on a regular basis? do you pass noresume2 (ore resume2=swap:/dev/hdx) to the kernel at every boot?
I pass "resume2=swap:/dev/hdx" at every boot.
If there's no image stored, kernel starts like if this option doesn't exist.

In case of problems, I use the edit function of grub ( :D ) to modify my kernel command line and add the "noresume2" argument.
Then, swapoff, mkswap and swapon to erase the bad stored image and have a clean swap space (I'm not sure you have to do all this stuff).
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
Maranza
n00b
n00b


Joined: 25 Jun 2004
Posts: 34

PostPosted: Thu Jan 20, 2005 6:47 pm    Post subject: Reply with quote

Quote:

If there's no image stored, kernel starts like if this option doesn't exist.

Then you DID know the answer to my question ;)
thanks

I'm already appending resume=swap:/dev/hdx through lilo, but i feared booting without noresume2 when booting a non-suspended system (i don't suspend every time). you're implying that this is safe?
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Fri Jan 21, 2005 8:44 am    Post subject: Reply with quote

Maranza wrote:
Quote:

If there's no image stored, kernel starts like if this option doesn't exist.

Then you DID know the answer to my question ;)
thanks
Misunderstood !!! :mrgreen:
I thought that you want to resume an old saved suspended session :
Maranza wrote:
i mean, can i safely try to resume an image even if i haven't suspended last time
:roll:

Maranza wrote:
I'm already appending resume=swap:/dev/hdx through lilo, but i feared booting without noresume2 when booting a non-suspended system (i don't suspend every time). you're implying that this is safe?
I've put the "resume=:/dev/hdx" kernel argument on every grub.conf kernel line (without noresume of course).
Booting without image stored (non-suspended system) never complained here ...

I think 2 big problems can occurs with swsup2 :
1 - system has been suspended but on next boot kernel doesn't have the swsusp feature : this can produce a corruption swap. So you have to swapoff + mkswap + swapon before your system needs swap.
2 - system has been suspended and rebooted on an other OS which can access to suspended partitions (example : fat32 partition for Linux/windows common datas). In this case, suspend image and real system aren't the same and I think you have to use the noresume2 argument to boot again on Linux ...

So you may have to have a noresume2 entry on your lilo.conf (no need with grub : edit function is really a great feature) ...
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
niin
Guru
Guru


Joined: 30 Dec 2004
Posts: 385
Location: Paris - France

PostPosted: Mon Feb 13, 2006 9:38 pm    Post subject: Reply with quote

I got a huge problem with swsuspend2 in X.

I followed what you said :
- I de-activated agpgart and re-emerged nvidia to use the NvAGP driver
- I configure xorg.conf as well
- I uncommented the unload nvidia module in the blacklisted-modules file
- I de-activated FW and SBA in the /etc/modules.d/nvidia

But still my computer can't store the image and freeze, while my screen has been shut down. So my monitor is off but my computer stays on undefinitely ; when i reboot (with reset button), it does a usual boot.

nb : it happens only in X ; when i'm still in console, the hibernate works well.
_________________
jabber : nikwist@koreus.com

Un clavier azerty en vaut deux

Un vrai geek, c'est un mec qui croit que dans 1 km, il y a 1024 mètres
Back to top
View user's profile Send private message
pennac
n00b
n00b


Joined: 29 Aug 2003
Posts: 9

PostPosted: Thu Apr 13, 2006 2:35 am    Post subject: Reply with quote

Good news, I have finally managed to get suspend2 works with nvidia module.

I have tried a couple of setup, but here's the last one which made it possible.

First, I did it with this kernel version :
Code:
sys-kernel/gentoo-sources-2.6.16-r2

this suspend2 version :
Code:
suspend2-2.2.4-for-2.6.16

and this nvidia-kernel module version :
Code:
media-video/nvidia-kernel-1.0.8756

Now, here's the hibernate options i had to tweak, which can be found in /etc/hibernate/hibernate.conf:
Code:
SwitchToTextMode yes
ProcSetting extra_pages_allowance 7500
UnloadBlacklistedModules yes
LoadModules auto

The specified ProcSetting was reported to fix problems with the ATI fglrx video driver, but hibernate could not suspend without it on my laptop. Here's the error it was reporting :
Code:
Pageset1 has grown by 353 pages. Only 100 growth is allowed for!

Setting the value to 7500 fixed this problem.

To skip nvidia unloading, i had to comment out the nvidia line in the /etc/hibernate/blacklisted-modules file.

I have completly removed agpart supports from the kernel and added the following option to /etc/X11/xorg.conf
Code:
Section "Device"
   Driver "nvidia"
   ...
   Option NvAGP "1"
   ...
EndSection


Here's some stats about the laptop for google search :

Code:
Toshiba M40
nVidia Corporation NV43 [GeForce Go 6600]
2.6.16-gentoo


Hibernate, cpufreq and sata suspend now make this laptop very interesting with linux.

Hope this can help some of you.
_________________
Pennac@Gentoo


Last edited by pennac on Fri Apr 14, 2006 2:26 pm; edited 2 times in total
Back to top
View user's profile Send private message
no4b
Bodhisattva
Bodhisattva


Joined: 18 Jan 2004
Posts: 774
Location: Tarnów, Poland

PostPosted: Thu Apr 13, 2006 10:51 pm    Post subject: Reply with quote

I can't get suspend2 working with nvidia (geforce4 mx). After resume I always see blackscreen, the machine (it's desktop pc, not laptop) seems to be hanged. I do not have agpgart in kernel/module. I do not use framebuffer. "SwitchToTextMode yes" does not help. I dunno how to fix it ;>
_________________
GTK2/GNOME - The weakest link!
Back to top
View user's profile Send private message
pennac
n00b
n00b


Joined: 29 Aug 2003
Posts: 9

PostPosted: Fri Apr 14, 2006 12:41 am    Post subject: Reply with quote

no4b wrote:
I can't get suspend2 working with nvidia (geforce4 mx).


What does /var/log/hibernate.log have to say about its operation ?
Did you try to hibernate without having Xorg running and nvidia module unloaded ?
_________________
Pennac@Gentoo
Back to top
View user's profile Send private message
no4b
Bodhisattva
Bodhisattva


Joined: 18 Jan 2004
Posts: 774
Location: Tarnów, Poland

PostPosted: Fri Apr 14, 2006 9:39 am    Post subject: Reply with quote

Code:
Starting suspend at pi± kwi 14 00:35:26 CEST 2006
hibernate: [01] Executing CheckLastResume ...
hibernate: [01] Executing LockFileGet ...
hibernate: [01] Executing NewKernelFileCheck ...
hibernate: [10] Executing EnsureSwsusp2Capable ...
hibernate: [50] Executing FilesystemsUnmount ...
Unmounting /home/abaddon/dane ...
Unmounting /mnt/c ...
hibernate: [89] Executing SaveKernelModprobe ...
hibernate: [91] Executing ModulesUnloadBlacklist ...
hibernate: [97] Executing ChangeToSwsuspVT ...
hibernate: [98] Executing Swsusp2ConfigSet ...
hibernate: [99] Executing DoSwsusp2 ...
hibernate: Activating suspend ...
hibernate: [97] Executing ChangeFromSwsuspVT ...
hibernate: [91] Executing GentooModulesAutoload ...
Loading modules listed /etc/modules.autoload.d/kernel-2.6
Loading bttv
Loading ip_conntrack_ftp
hibernate: [89] Executing RestoreKernelModprobe ...
hibernate: [70] Executing ClockRestore ...
hibernate: [20] Executing MiscLaunchAuxFunc1 ...
Executing mount /home/abaddon/dane...
hibernate: [01] Executing NoteLastResume ...
hibernate: [01] Executing LockFilePut ...
Resumed at pi± kwi 14 00:36:11 CEST 2006


Quote:
Did you try to hibernate without having Xorg running and nvidia module unloaded ?


Yes, I did. The pure console hibernates ok (xorg + nv instead of nvidia too).
_________________
GTK2/GNOME - The weakest link!
Back to top
View user's profile Send private message
pennac
n00b
n00b


Joined: 29 Aug 2003
Posts: 9

PostPosted: Fri Apr 14, 2006 2:25 pm    Post subject: Reply with quote

no4b wrote:
Yes, I did. The pure console hibernates ok (xorg + nv instead of nvidia too).


I forgot to mention that i had to emerge this version of nvidia-kernel before any successful hibernation :
Code:
media-video/nvidia-kernel-1.0.8756


It seems that you can't resume, but did your get through the full suspend, having the computer shut down ?

If so, when resuming, did you try to switch to console with CTRL-ALT-F1 ? I'm asking because on my laptop, when resuming, the screen goes black for a while before finally resuming to X.

Does the previous "dmesg" output tell you something strange after a successful reboot ?
_________________
Pennac@Gentoo
Back to top
View user's profile Send private message
XioXouS
n00b
n00b


Joined: 01 Apr 2005
Posts: 59

PostPosted: Mon May 29, 2006 9:52 pm    Post subject: Reply with quote

no4b,
I was having similar problems where I could suspend in text mode but X would hang with a black screen on resume. I found out today that I had to disable AGP entirely. ie: in xorg.conf add
Code:
"Option" "NvAGP" "0"
under the Device subsection. You could always run X with AGP disabled most of the time and then reload it with AGP turned on whenever you wanted to play games. Kind of annoying, but it works.
Back to top
View user's profile Send private message
Phlogiston
Veteran
Veteran


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Sun Aug 27, 2006 8:25 pm    Post subject: Reply with quote

Hmm same problem here, is there an other solution for this? I'd like to use suspend2 + nvidia+ intel agpgart.
_________________
Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor
Back to top
View user's profile Send private message
badgers
l33t
l33t


Joined: 04 Sep 2003
Posts: 680
Location: Madison, WI

PostPosted: Wed Sep 20, 2006 6:04 pm    Post subject: Reply with quote

pennac wrote:
no4b wrote:
Yes, I did. The pure console hibernates ok (xorg + nv instead of nvidia too).


I forgot to mention that i had to emerge this version of nvidia-kernel before any successful hibernation :
Code:
media-video/nvidia-kernel-1.0.8756


It seems that you can't resume, but did your get through the full suspend, having the computer shut down ?

If so, when resuming, did you try to switch to console with CTRL-ALT-F1 ? I'm asking because on my laptop, when resuming, the screen goes black for a while before finally resuming to X.

Does the previous "dmesg" output tell you something strange after a successful reboot ?


My suspend to ram woks with the console. How do I use NV instead of Nvidia?
I followed the howto for Nvidia since I have a GF3 Ti

If I have to re-emerge Xorg that will take a whole day....

thanks
_________________
Abit KD7-S
Athlon XP2500+
166mHz FSB
512 Meg PC3200 Ram running at 166mHz
LiteOn DVD dual Layer burner(hdc)

2.6.17 Suspend2 kernel with no scsi support
Back to top
View user's profile Send private message
badgers
l33t
l33t


Joined: 04 Sep 2003
Posts: 680
Location: Madison, WI

PostPosted: Mon Sep 25, 2006 8:46 pm    Post subject: Reply with quote

did the format of the hibernate script config files change?

I don't seem to have things the way that you have
Code:

DavidCPU linux # eix suspend
[I] sys-apps/suspend2-userui
     Available versions:  0.6.3-r1 0.6.4 0.6.4-r1
     Installed:           0.6.4-r1
     Homepage:            http://www.suspend2.net
     Description:         User Interface for Software Suspend 2

DavidCPU linux # cd /etc/hibernate/
DavidCPU hibernate # ls
total 44K
drwxr-xr-x  3 root root 4.0K Sep 19 05:51 .
drwxr-xr-x 86 root root 8.0K Sep 25 15:16 ..
-rw-r--r--  1 root root 1.8K Sep 25 15:07 blacklisted-modules
-rw-r--r--  1 root root 3.2K Sep 25 14:47 common.conf
-rw-r--r--  1 root root  345 Sep 19 05:51 disk.conf
-rw-r--r--  1 root root  542 Sep 19 05:51 hibernate.conf
-rw-r--r--  1 root root  631 Sep 20 06:57 ram.conf
drwxr-xr-x  2 root root   47 Sep 19 05:51 scriptlets.d
-rw-r--r--  1 root root 1.3K Sep 19 08:04 suspend2.conf
-rw-r--r--  1 root root  468 Sep 19 08:23 ususpend.conf

thanks
_________________
Abit KD7-S
Athlon XP2500+
166mHz FSB
512 Meg PC3200 Ram running at 166mHz
LiteOn DVD dual Layer burner(hdc)

2.6.17 Suspend2 kernel with no scsi support
Back to top
View user's profile Send private message
badgers
l33t
l33t


Joined: 04 Sep 2003
Posts: 680
Location: Madison, WI

PostPosted: Tue Sep 26, 2006 2:05 pm    Post subject: Reply with quote

I have it working now.
I just issue the hibernate command and then push the power button for it to wake up.

is it possible to make it wake up when I hit the keyboard or move the mouse.

Idealy I would like it to WOL, but that is not a big issue.

thanks for this thread.
_________________
Abit KD7-S
Athlon XP2500+
166mHz FSB
512 Meg PC3200 Ram running at 166mHz
LiteOn DVD dual Layer burner(hdc)

2.6.17 Suspend2 kernel with no scsi support
Back to top
View user's profile Send private message
badgers
l33t
l33t


Joined: 04 Sep 2003
Posts: 680
Location: Madison, WI

PostPosted: Wed Sep 27, 2006 4:06 pm    Post subject: Reply with quote

I have run glxgears and I get 19 FPS with a GF3 ti200

does that seem really low?
_________________
Abit KD7-S
Athlon XP2500+
166mHz FSB
512 Meg PC3200 Ram running at 166mHz
LiteOn DVD dual Layer burner(hdc)

2.6.17 Suspend2 kernel with no scsi support
Back to top
View user's profile Send private message
Thesee
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jun 2004
Posts: 138
Location: Belgium

PostPosted: Tue Nov 21, 2006 7:14 pm    Post subject: Reply with quote

I wanted to thank all of you for this post because I finally got this hibernate working (it was the NvAgp to be set to 0 that did the trick).
And therefore my question: any news about this? Will we always have to remove the AGP to hibernate?
_________________
How does a UNIX expert have sex?
Unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep.
Back to top
View user's profile Send private message
stalker
n00b
n00b


Joined: 18 Jun 2003
Posts: 41

PostPosted: Wed Dec 20, 2006 3:04 am    Post subject: Reply with quote

I would like to re-iterate the fact that to get a nvidia chip to suspend with X that you need to have agpgart not installed. Or that is what I believed, it seems that having NvAGP set to 0 has the same effect, or not loading agpgart.

I would like to disagree with yoyo about setting NvAGP to 3. I told Thesee to set it to 1, instead of 3, and his system was them able to hibernate properly, and still have agp functionality.

The issue is that "3" tries to load agpgart first before attempting to use nvidia's agp. So if agpgart is on the system, then it will be loaded and then it won't hibernate. Using "1" skips that and ensures that nvidia's agp is loaded. Which is what allows us to continue.

And I should also recap that nvidia's binary driver (the later the better) is what is being used here, I don't think people should be using the NV driver instead of Nvidia's with hibernation. I'm not saying it won't work, I'm just saying that the results aren't as prevalent.
_________________
Look behind you...

Think outside the box, give the cat a chance.
Back to top
View user's profile Send private message
nejiron
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 95
Location: U.S.A.

PostPosted: Thu Sep 06, 2007 3:09 am    Post subject: Reply with quote

Just wanted to let everyone know that I got it working fine with ~amd64 keywords and the following setup:

Linux 2.6.22-kamikaze6 #4 PREEMPT Wed Sep 5 19:41:25 EDT 2007 x86_64 AMD Athlon(tm) 64 Processor 3400+ AuthenticAMD GNU/Linux
VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5200] (rev a1) w/ x11-drivers/nvidia-drivers-100.14.11

Here is my hibernate.conf:

FBSplash on
FBSplashTheme suspend2
ProcSetting full_pageset2 1
ProcSetting extra_pages_allowance 0
UnloadBlacklistedModules yes
LoadModules auto
GentooModulesAutoload yes
SwitchToTextMode yes
UseDummyXServer yes

(Note: I also have the framebuffer splash on and it works with hibernate)

and in xorg.conf I have:

Option "NvAGP" "1"


Hope this helps someone...
_________________
I am a traveler of both time and space
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum