You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SB2 freezes in sleep mode or after closing the lid #223
Looks like there are some crashes in the nouveau module. You might want to blacklist that if you're not using it. If you plan to use the dGPU, I recommend you use the proprietary nvidia module 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.
Could you upload a log from when this is happening? If you have to force-shutdown, you can try journalctl -b -1 to get the log from the last boot (the -1 indicates the previous boot, can also be changed to -2 etc.). If you can reproduce this via some specific steps, can you share those?
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.log to 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.
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.
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.
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 status gives me this.
Note that it says
Jul 13 21:07:10 katiebook bumblebeed[350]: modprobe: ERROR: could not insert 'bbswitch': No such device.
surface status tells me
Performance-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.
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=none in /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.
Activity
qzed commentedon Jun 30, 2020
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.khalleu commentedon Jul 8, 2020
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!
qzed commentedon Jul 8, 2020
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?khalleu commentedon Jul 9, 2020
Sure!
I've reproduced the issue by closing my laptop and reopening it and I've pasted my logs here.
qzed commentedon Jul 9, 2020
So the dGPU has not been powered on before suspending?
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.khalleu commentedon Jul 9, 2020
My bad! You can find my logs here.
The dGPU is powered on at startup, and the performance mode is set to normal.
$ surface statusPerformance-Mode: Normal (1)dGPU-Power: onqzed commentedon Jul 10, 2020
Thanks! 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.
khalleu commentedon Jul 11, 2020
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.Here's the make.log.
However, this may be because I didn't set
CONFIG_SERIAL_DEV_BUS=yCONFIG_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!!
qzed commentedon Jul 11, 2020
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.
khalleu commentedon Jul 12, 2020
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.
qzed commentedon Jul 13, 2020
Neat! The upcoming releases contain the fix (v5.7.8 and v4.19.132).
khalleu commentedon Jul 14, 2020
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 statusbbswitch, 0.8, 4.19.132-1-surface-lts, x86_64: installednvidia, 450.57, 4.19.132-1-surface-lts, x86_64: installedThanks again!
qzed commentedon Jul 14, 2020
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.