Repository navigation
SB2 freezes in sleep mode or after closing the lid #223
Description
Activity
Looks like there are some crashes in the
nouveaumodule. You might want to blacklist that if you're not using it. If you plan to use the dGPU, I recommend you use the proprietarynvidiamodule instead.Chiming in (I'm quite new to this), I'm experiencing the same issue with both the latest and the LTS kernel on Arch. I'm using nvidia-dkms. When I attempt to wake my SB2 from suspension, I just see a black screen with a cursor.
Is there any information you need?
Thanks in advance!
Could you upload a log from when this is happening? If you have to force-shutdown, you can try
journalctl -b -1to get the log from the last boot (the-1indicates the previous boot, can also be changed to-2etc.). If you can reproduce this via some specific steps, can you share those?Sure!
I've reproduced the issue by closing my laptop and reopening it and I've pasted my logs here.
I've reproduced the issue by closing my laptop and reopening it
So the dGPU has not been powered on before suspending?
I've pasted my logs here.
Those don't look complete. There should at least be a message about entering suspend in there. You can write the full logs to a file (e.g.
output.log) by appending> output.logto the command. Also make sure that you're getting the correct one, i.e. the one from when the failure occured, with the-b -<number>flags.My bad! You can find my logs here.
The dGPU is powered on at startup, and the performance mode is set to normal.
$ surface status
Performance-Mode: Normal (1)
dGPU-Power: onThanks! I think I've found the issue and fixed it in linux-surface/surface-aggregator-module@fbd22f9. You can test this by cloning that repo and following the instructions in https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing#buildtest-the-modules (you probably want to install the module with dkms for this).
However, I should note that I do not recommend turning on the dGPU automatically (before your desktop environment, e.g. Gnome has been started). At least in my experience, the dGPU generates a significant amount of heat if the device has been suspended with the dGPU turned on. I'd rather recommend that you use something like optirun/primusrun and turn on the dGPU on demand, closing all dGPU using applications and turning it off before suspending the device. This is unfortunately an issue I haven't been able to track down yet and likely won't get to in the foreseeable future.
Unfortunately it's also (at least with Gnome) not possible to turn off the dGPU before suspending, as Gnome (by default) for some reason accesses the dGPU, so if you try to turn it off before suspend, the device gets yanked from Gnome, which it does not handle gracefully. I've tried to do that in kernel, i.e. turn-off the dGPU after all user-space applications, including Gnome, have been suspended and turning it on again before user-space resumes, but that still causes issues as the nvidia driver doesn't handle the loss of the device gracefully either if there's some client still using the device, even if the client has been suspended.
In short, I recommend you turn on the dGPU only on demand and turn it off before suspend. The other issues I mentioned are currently wontfix for me and likely require someone with a lot more knowledge about PCI (specifically hot-plug and suspend/resume) than I have.
Unfortunately, I can't seem to be able to install it:
$ sudo dkpg autoinstall
`Kernel preparation unnecessary for this kernel. Skipping...`
Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.19.131-1-surface-lts all KVERSION=4.19.131-1-surface-lts...(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.19.131-1-surface-lts (x86_64)
Consult /var/lib/dkms/surface_sam/0.1/build/make.log for more information.However, this may be because I didn't set
CONFIG_SERIAL_DEV_BUS=y
CONFIG_SERIAL_DEV_CTRL_TTYPORT=yas required here. Where can I set these?
Lastly, I'll give primusrun a try. I've been using prime, which doesn't work unless the dGPU is turned on before gdm starts. I've tried using bumblebee in the past, but I've experienced significant performance issues in doing so.
Thanks in advance!!
Ah, installing fails because the module doesn't support v4.19 kernels (without a couple changes). Can you test this on a newer kernel?
I'll update the 4.19 patches with those changes if that works.
It works in 5.7.7! Thank you so much.
Keep us posted on the 4.19 patch! I've been using the LTS kernel because I frequently use both pen and touch support.
Neat! The upcoming releases contain the fix (v5.7.8 and v4.19.132).
Thank you! It works great now. ✌
One last question though: As suggested, I'm trying primusrun. From what I understand, primusrun relies on bumblebee, which uses bbtoggle to turn off the dgpu when not in use.
sudo systemctl bumblebeed.service statusgives me this.Note that it says
Jul 13 21:07:10 katiebook bumblebeed[350]: modprobe: ERROR: could not insert 'bbswitch': No such device.surface statustells mePerformance-Mode: Normal (1)
dGPU-Power: off.Is there something I'm doing wrong? Asking here because this may be kernel related. I'm using bbswitch-dkms.
$ dkms status
bbswitch, 0.8, 4.19.132-1-surface-lts, x86_64: installed
nvidia, 450.57, 4.19.132-1-surface-lts, x86_64: installedThanks again!
You'll have to manually turn on/off the dGPU as there isn't any integration for bumblebee at the moment. You should also set
PMMethod=nonein/etc/bumblebee/bumblebee.conf, so that it doesn't attempt to use bbswitch. Here are a bit more details: https://github.com/linux-surface/surface-aggregator-module/wiki/Discrete-GPU.
Hi,
My SB2 freezes right after putting it to sleep. Screen turns dark, I see the cursor and it freezes.
Surface Book 25.7.5Ubuntu 20.04 LTSdmesg output: https://hastebin.com/ponevexaqu.coffeescript
Thanks for your help!