Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU unusable after wake from sleep on Arch Linux #961

Open
MicroDroid opened this issue May 3, 2018 · 7 comments
Open

GPU unusable after wake from sleep on Arch Linux #961

MicroDroid opened this issue May 3, 2018 · 7 comments

Comments

@MicroDroid
Copy link

After wake up from sleep (suspend to RAM):

$ optirun echo hi
[58168.281473] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0.  Please

[58168.281502] [ERROR]Aborting because fallback start is disabled.

Relevant dmesg:

[58169.423781] NVRM: RmInitAdapter failed! (0x26:0xffff:1123)
[58169.423808] NVRM: rm_init_adapter failed for device bearing minor number 0

Useful stuff:

$ pacman -Q bumblebee
bumblebee 3.2.1-16
$ pacman -Q nvidia
nvidia 390.48-3
$ lspci | grep -e "VGA"
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)
$ # wait where's my nvidia?
$ # if i am not mistaken, it should be there, no?

GPU: Nvidia GeForce 930MX

@msh0001
Copy link

msh0001 commented May 13, 2018

I had your exact same issue with the same error from optirun and the same dmesg and I fixed it using this https://wiki.archlinux.org/index.php/bumblebee#Failed_to_initialize_the_NVIDIA_GPU_at_PCI:1:0:0_.28Bumblebee_daemon_reported:_error:_.5BXORG.5D_.28EE.29_NVIDIA.28GPU-0.29.29 that worked for me and you can make a script easily if you want.

@MicroDroid
Copy link
Author

MicroDroid commented May 13, 2018

@msh0001 YES! That did work. I wonder why I haven't seen that command before even though I read the wiki page like 3 times before.

I ended up with this service in /etc/systemd/system/gpu-fix.service:

[Unit]
Description=Fix GPU after waking up from suspension
After=suspend.target

[Service]
User=root
Type=oneshot
# Sleep is because we want to ensure fastest wake up
ExecStart=/usr/bin/bash -c "sleep 2 && echo 1 > /sys/bus/pci/rescan"
TimeoutSec=0

[Install]
WantedBy=suspend.target

I am keeping this open because this doesn't make it not a bumblebee bug.

@Vortelf
Copy link

Vortelf commented May 20, 2018

Can't believe this. I had this issue for 2 years and it's finally fixed.

@MicroDroid
Copy link
Author

@Vortelf I can't believe you had this problem for two years and you haven't even bothered to open an issue :P

@Vortelf
Copy link

Vortelf commented May 20, 2018

@MicroDroid Indeed :D
I gave up and continued onward with restarting my laptop whenever I needed the discrete GPU.

@iNoSec
Copy link

iNoSec commented Jun 17, 2018

work on debian stretch too but thats a fucking issue and doing this or script this is boring, i dont understand why thats make that because i never did it, in the past bumblebee works well after sleep

for those who want the script thats on my github

@kdstew
Copy link

kdstew commented Dec 7, 2018

On ubuntu 18.10 I had what appeared to be a similar issue but after waking from sleep i was unable to login and @MicroDroid's service resolved the issue (Thank you!). Later while looking at some documentation for TLP I noticed https://wiki.archlinux.org/index.php/TLP#Bumblebee_with_NVIDIA_driver. After blacklisting my NVIDIA device in TLP's config and removing the previously mentioned fix the problem was also gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants