You are not logged in.

#1 2020-02-06 04:24:29

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

[SOLVED] Nvidia Optimus "Sanity Check"

Hello Everyone!


I've been using Arch for a little while now and have battled the demon that is Nvidia Optimus for some time as well.

As of late I have began moving away from such tactics as optimus-manager/nvidia-xrun (Although nvidia-xrun has been the goat in keeping my Arch Linux Desktop dreams alive), and opted to move to the "Use NVIDIA graphics only" as stated in the "NVIDIA Optimus" section of the Arch wiki as I do not use Intel graphics for the type of development I do.

Over the last few weeks there has been much breakage that I had not faced in months prior when using optimus-manager and I attempted to contact the package maintainer via github with no avail which is one reason I am steering away from that method. Link to that post here.

I was directed to this recent Arch forum post that talked about a recent issue with Nvidia graphics and used it and the Arch wiki to de-mangle my system which has worked to some degree (I still use nvidia-xrun to switch graphics at boot).

In the last few days I have added the proper kernel modules to the kernel parameters and get no errors when I mkinitcpio -P.

I use Lightdm and Openbox, but I cannot get Lightdm to work at boot anymore and I have to switch to another tty and run "sudo nvidia-xrun openbox-session" to start my desktop.

My system is fully updated and I last ran a full system update yesterday.

Laptop: Clevo N855HJ
OS: Arch Linux x86_64
Host: N85_N87,HJ,HJ1,HK1
Kernel: 4.19.101-1-lts
CPU: Intel i7-7700HQ (8) @ 3.800GHz
GPU: NVIDIA GeForce GTX 1050 Mobile
GPU: Intel HD Graphics 630
DM: Lightdm
WM: Openbox


If anyone has any opinions on the matter or links on this issue I would appreciate some insight.

Thanks!

I wish I had a mux-switch SO bad:(

Last edited by Flowingisart (2020-02-07 18:34:10)

Offline

#2 2020-02-06 08:14:04

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,716

Re: [SOLVED] Nvidia Optimus "Sanity Check"

If your goal is to really only and primarily use Nvidia graphics remove nvidia-xrun and follow https://wiki.archlinux.org/index.php/NV … phics_only and https://wiki.archlinux.org/index.php/NV … us#LightDM

As the warning makes clear, the approaches are mutually exclusive so you are likely to expectably break something if you have nvidia-xrun set up in addition to the Use nvidia graphics only setup. You should also not habitually sudo things, there's a good chance you will break something. There should never be a reason to run sudo nvidia-xrun.

Last edited by V1del (2020-02-06 08:18:28)

Offline

#3 2020-02-06 09:42:05

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

I've followed the directions exactly what is in the wiki for the nvidia only method.

I touched a few things in the X11 folder and got lightdm to work but every time I still run to a road block when logging into openbox and it bounces me back out to the lightdm screen.

What is my X11 folder suppose to look like with this method hmm

I have so much junk in there from trying to configure my graphics...

Offline

#4 2020-02-06 12:51:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,716

Re: [SOLVED] Nvidia Optimus "Sanity Check"

You should only have that single file there at the location mentioned. (Unless you have other files that do something with e.g. input devices, but graphics related in /etc/X11/xorg.conf.d/ only the file mentioned in that article) and no optimus-manager, nvidia-xrun nor nvidia-prime installed.

That's all I can say on a whim, you might want to post the contents of said "junk" so that we can tell you exactly why something breaks. A xorg log/journal log while you are being bounced out of openbox would help as well and fwiw your openbox configuration files especially autostart scripts and the like.

Last edited by V1del (2020-02-06 12:53:51)

Offline

#5 2020-02-06 18:01:47

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

Alright.

Before all of this when I was uninstalling optimus-manager I made sure to give it the --cleanup option.
Nvidia-xrun is uninstalled.
I have cleaned out the /etc/X11 so that there is only xorg.conf.d directory with the 10-nvidia-drm-outputclass.conf file inside.

Here are the log files from the last run.
Lightdm
Xorg

Offline

#6 2020-02-06 18:18:19

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

And here are the contents of my ~/.config/openbox...
autostart
menu.xml
menu.xml.bak
rc.xml

Offline

#7 2020-02-06 18:58:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,716

Re: [SOLVED] Nvidia Optimus "Sanity Check"

lightdm config and the display-setup.sh you've created? And the permissions of said display-setup.sh ? also maybe a journal log after the log in and relevant drop back from openbox happens. So far xorg log wise looks ok.

Offline

#8 2020-02-06 18:58:14

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

Hold up... the lightdm log got mixed up so I'm updating the links.

Apologies~

----------------------------------------------------------------------------------------------------------------------------------------

Here are the next set files you asked for plus the lightdm logs I mixed up.
The permissions of display-setup.sh are [-rwxr-xr-x]

I'll have the journal log up in a moment.

----------------------------------------------------------------------------------------------------------------------------------------

I'm not seeing anything using journalctl that refers to openbox logging in.
The last messages that I see have to do with NetworkManager hmm

----------------------------------------------------------------------------------------------------------------------------------------

However... When I go to startx as a user I am getting...

xf86EnableIOPorts: failed set set IOPL for I/O (Operation not permitted)

Here is the stdout, stderr, and log file from startx.

----------------------------------------------------------------------------------------------------------------------------------------

Found .nvidia-settings-rc and .nvidia-xinitrc in my home folder and removed them as well.
nvidia-settings was uninstalled before all of this as well.

xf86EnableIOPorts: failed set set IOPL for I/O (Operation not permitted)

...still persists.

Last edited by Flowingisart (2020-02-07 10:04:09)

Offline

#9 2020-02-07 10:49:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,716

Re: [SOLVED] Nvidia Optimus "Sanity Check"

Thanks for combining and properly reporting the serial posts.

For the startx method, it looks like the server properly starts but immediately dies, post your .xinitrc .

Offline

#10 2020-02-07 10:58:57

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

Of course~

~/.xinitrc

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

Offline

#11 2020-02-07 15:12:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,716

Re: [SOLVED] Nvidia Optimus "Sanity Check"

You actually have to start something in that if you expect startx to actually give you a proper session.

https://wiki.archlinux.org/index.php/Xinit#xinitrc note the blue boxes for the necessary baseline, once you've copied over the system file, add these three lines so that the end of the file reads

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
exec openbox-session

if this still breaks, change the openbox-session to

exec openbox

if the second one works, then something in your openbox autostart scripts breaks here.

Last edited by V1del (2020-02-07 15:13:13)

Offline

#12 2020-02-07 17:05:15

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

When I try both openbox-session and openbox; lightdm still kicks me out.

Here's my ~/.xinitrc, /var/log/lightdm/lightdm.log, and /var/log/lightdm/x-0.log

When I startx from console I get a blackscreen and doesn't seem to produce any logs.

Offline

#13 2020-02-07 17:15:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,716

Re: [SOLVED] Nvidia Optimus "Sanity Check"

Remove this block:

twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login

retry startx.

Offline

#14 2020-02-07 17:39:21

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

:)startx works with openbox-session too!

Fri Feb  7 09:33:58 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59       Driver Version: 440.59       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   38C    P8    N/A /  N/A |     75MiB /  2000MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       622      G   /usr/lib/Xorg                                 26MiB |
|    0       703      G   /usr/lib/Xorg                                 46MiB |
+-----------------------------------------------------------------------------+

The GPU memory usage is higher than nvidia-xrun but that's not a huge deal.

Lightdm is still kicking me out though:/
The current x-0.log the same as the one posted above the only difference is the generated timestamp.

Last edited by Flowingisart (2020-02-07 18:00:19)

Offline

#15 2020-02-07 18:19:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 8,716

Re: [SOLVED] Nvidia Optimus "Sanity Check"

I'd say drop lightdm and use another alternative if it is that uncooperative, nvidia-xrun uses the same underlying process so that is either placebo or weird configuration. I find it strange that there seem to be two xorgs running on that, I suspect one of them is a weird lightdm zombie. Or you are doing something in that polybar launch.sh that causes a second screen to be launched, FWIW can you post that?

Offline

#16 2020-02-07 18:31:41

Flowingisart
Member
Registered: 2017-11-21
Posts: 16

Re: [SOLVED] Nvidia Optimus "Sanity Check"

I believe the other xorg is lightdm/lightdm-gtk-greeter since I startx in tty2.
Here is nvidia-smi after I disable lightdm, reboot, and startx.

Fri Feb  7 10:26:36 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59       Driver Version: 440.59       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   39C    P8    N/A /  N/A |     47MiB /  2000MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       584      G   /usr/lib/Xorg                                 45MiB |
+-----------------------------------------------------------------------------+

The lightdm issue is beyond the scope of this ordeal anyways.
I'll mess around with lightdm and try out some different display managers and see what comes up.

Thanks again for all your help; It was great working with you, and I appreciate it!:)
I'll be sure to mark the post as solved.

Last edited by Flowingisart (2020-02-10 20:09:43)

Offline

Board footer

Powered by FluxBB