nvidia-xrun
nvidia-xrun copied to clipboard
Existing desktop environment running on intel GPU goes black
After running nvidia-xrun and starting a new desktop environment using it, the existing running environment (on intel GPU) starts showing black screen with keyboard cursor. I have tried with same results on plasma (xorg) and Gnome (wayland). Restarting laptop is the only method to use it again (restarting display manager also doesnt work). I have a Nvidia MX150M with intel core i5-8250U (intel UHD 620) on my ASUS S510UXN.
Is this how is it supposed to work or this is a problem ?
Thanks.
I'm interested in this as well.
I'm using KDE for my normal desktop environment (with the integrated card). When I switch over from the tty I'm using for nvidia-xrun
, it seems like the existing KDE desktop environment works around 50% of the time. The other times, it crashes out (and sometimes brings the other tty with it).
Is this expected behavior?
(btw @Witko, thanks for creating this! It works ~4 times as fast as using bumblebee for me, and is really cool.)
Hi Guys, not sure i understand the issue completely. In general if you run 2 Plasmas at the same time that wont work i believe - but thats a KDE stuff. I usually have Plasma & openbox at the same time. I also sometimes go to Plasma via nvidia-xrun but then i have only sddm running - so no other plasma. Im not observing any issues with this on my pc. In general im not sure whether any of the desktop envs can run twice under same user account. Maybe create another user for gaming:)
Well actually i have tried using different desktop environments for intel and nvidia as well. Like gnome(wayland/xorg both) on intel and kde on nvidia but same results. But if i am not logged in to any user before starting nvidia-xrun, then i can login back using intel again.
It would be a good option if we could make a login entry for desktop managers (like gnome on nvidia) which would setup nvidia-xrun in the background and startup full desktop on it.
This i have on my mind for some time. Not sure when i'll have some spare time to look into it. The idea would be to be able to start a game from a running session, This would spawn openbox for example.
Do you have something in logs?
To clarify, I'm running KDE in one tty (using the integrated card) and Openbox in the other (with nvidia-xrun
and the dedicated card).
I'd like to be able to switch between these two ttys at will, but often when I switch TTYs the entire screen will go blank and both TTYs will lose their running windows.
Hmm, i often do that too without any issues. Anything in the logs?
Not the OP, and not exactly the same setup, but my issue seems related, so let me tell you my story:
My system consisted of LXDM logging in to XFCE session. Then I would occasionally run nvidia-xrun
to launch LXDE session with the same user on another tty. Could switch back and forth the two ttys with Xorgs all day long - no video tearing, no black screen, all worked perfect. Bear in mind, the system (and so the nvidia driver) was 1.5 months out of date (counting from now). And there may have been some leftover configs from older times.
Did fresh install of Archlinux this week. Same laptop.
New system, very similar setup - LXDM logging in to XFCE session. But now with a separate user for logging in on another tty and launching LXDE session with nvidia-xrun
. And now I do often get the same issue as OP - when switching back to intel XFCE session I get blank black screen, no response to keyboard input and mouse. Can always return to nvidia session without problems, though.
The bug is inconsistent, but it's appearance seems loosely related to the previous config used to power on the nvidia GPU. Okay, this one sounds weird, but there certainly is some correlation observed.
After some blind experimenting, I found the way to "avoid" the bug - when lxdm.service
is disabled, if after reboot I log in to console tty and do startx manually for the intel XFCE session, then there is no problem launching LXDE with nvidia-xrun
on another tty with second user, and switching back and forth two sessions.
As a side note, in this case I do get some screen tearing and glitches in OpenGL apps after switching, but that doesn't concern me so for now i'm not trying this.
Now, there is more - there is one consistent thing about this bug. Whenever the issue happens, and intel session goes blank screen, then after going back to nvidia session and properly turning it off (logout from graphical interface), there is always a failure to unload nvidia_drm
module, and nvidia GPU fails to turn off. Similar to the Issue #32 . The opposite is also true - if intel session stays alive and well, the nvidia GPU always turns off gracefully, modules unload properly.
Maybe this issue is also systemd related, maybe proper session configuration is needed in LXDM... i tried to find the culprit in /etc/lxdm/Xsession
, /usr/bin/startx
, tried different .xinitrc
's - well, no luck for me yet. Logs show some stuff going wrong, but much of that happens also in the "good" scenario, so for me it looks more related to what Nvidia recently did with 390xx drivers than this issue.
Anyway - the point is I would be glad to provide some logs and configs if it helps to investigate, since for me this thing is reproducible and may be related to/same as original issue. Please request the specific info needed. I also got a runnable copy of older system, if need for some info from there would arise (which I doubt, but anyway).
Current system:
Asus K53SV
Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
2nd Generation Core Processor Family Integrated Graphics Controller
NVIDIA Corporation GF108M [GeForce GT 540M]
Linux 4.17.11-arch1 x86_64 GNU/Linux
xf86-video-intel 1:2.99.917+831+ge7bfc906-1
nvidia-390xx 390.77-2
lxdm 0.5.3-6
xfce4-session 4.12.1-8
lxsession 1:0.5.3-1
nvidia-xrun 0.3-0
bbswitch 0.8-152
P.S. nvidia-xrun is awesome, got a significant speedup after switching from bumblebee, please keep up the good work.
@Witko I'm also having this issue, where when I run the NVIDIA openbox and try to switch back to the Intel KDE, the Intel tty is just a black screen until I switch back to NVIDIA. I can switch back and forth for about 15 seconds after starting nvidia-xrun, but after that it's just a black screen. Let me know if there's anything you want me to try or logs to post.
I think I have the same issue as well, though I've only been able to reliably reproduce it today.
New system, very similar setup - LXDM logging in to XFCE session. But now with a separate user for logging in on another tty and launching LXDE session with
nvidia-xrun
. And now I do often get the same issue as OP - when switching back to intel XFCE session I get blank black screen, no response to keyboard input and mouse. Can always return to nvidia session without problems, though.
Same here, although on my case I have SDDM and KDE on Intel, and Openbox on NVIDIA, and I use the same user for both.
Now, there is more - there is one consistent thing about this bug. Whenever the issue happens, and intel session goes blank screen, then after going back to nvidia session and properly turning it off (logout from graphical interface), there is always a failure to unload
nvidia_drm
module, and nvidia GPU fails to turn off. Similar to the Issue #32 . The opposite is also true - if intel session stays alive and well, the nvidia GPU always turns off gracefully, modules unload properly.
I noticed this too, but I also found out that after nvidia-xrun fails to unload nvidia_drm, if I stop SDDM, start Openbox with nvidia-xrun and close it, nvidia-xrun will be able to unload nvidia_drm, and restarting SDDM after this will allow me to get KDE back on Intel.
Update: Apparently, after restarting SDDM and logging in through there, if I try to start nvidia-xrun again and switch between the two sessions both of them will end up dead (the Intel one just goes black, while on the NVIDIA one Xorg just crashes, then nvidia-xrun will try (and fail) to unload nvidia_drm.
In addition, looking at Xorg.0.log.old after the Intel session goes black, I noticed that it had these lines at the end:
[ 22.988] (II) AIGLX: Suspending AIGLX clients for VT switch [ 37.535] (II) config/udev: removing GPU device /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 /dev/dri/card1 [ 37.535] (II) config/udev: Adding drm device (/dev/dri/card1) [ 37.535] (II) xfree86: Adding drm device (/dev/dri/card1) [ 45.256] (II) AIGLX: Resuming AIGLX clients after VT switch [ 45.256] (EE) modeset(0): drmSetMaster failed: Invalid argument [ 45.256] (EE) modeset(0): failed to set mode: Permission denied [ 45.256] (EE) Fatal server error: [ 45.256] (EE) EnterVT failed for screen 0 [ 45.256] (EE) [ 45.256] (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. [ 45.256] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. [ 45.256] (EE) [ 45.257] (II) AIGLX: Suspending AIGLX clients for VT switch [ 45.309] (EE) Server terminated with error (1). Closing log file.
I've attached the whole log below in case it's helpful. Xorg.0.log
System details: MSI GP62-6QF Intel Core i7-6700HQ Intel HD Graphics 530 and NVIDIA GeForce GTX 960M
Linux 4.18.7.arch1-1 Using modesetting at the moment, although the issue still happened with xf86-video-intel previously, but not as reliably reproducible nvidia 396.54-4 mesa 18.2.0-1 sddm 0.18.0-1
Used to have this issue with Intel + KDE Plasma on tty1 and Nvidia + Openbox on tty2. I fixed it by some, if not all, of the following actions:
- Made sure default X config,
/etc/X11/xorg.conf
, only have oneDevice
section, which is only for Intel. Previously I also had entry for Nvidia, despiteServerLayout
section havingInactive "nvidia"
line, but that was clearly unnecessary since we don't need any Nvidia thingies in default X server (tty1). - Made sure Driver for Intel is truly set to
intel
. Previously I had it asmodesetting
. On a side note I'm using unstable padoka PPA for Intel driver (PPA since I'm on KDE neon 5.15 / Ubuntu 18.04 LTS).
I sorta did both at the same time on my previous session, reboot, and voila, surprisingly I stopped having this issue altogether (plus better performance in default X server, I think).
UPDATE 25/06/2019: I ended up going through this again, after purging xserver-xorg-video-intel-hwe-18.04
to install xserver-xorg-video-intel
, since I'm using Padoka's PPA which appears to have more up-to-date drivers.
The whole thing kinda ended up removing my /etc/X11/xorg.conf
after all.
Here's a gist to a bare minimum xorg config that I could use to solve the issue, https://gist.github.com/BobbyWibowo/6df38f8b6c98142b3a9418ba91b91543.
And I think the config already uses the best AccelMethod
there is to be used with Intel graphics as well.