You are not logged in.

#1 2020-10-02 14:08:45

RichKat
Member
Registered: 2020-08-15
Posts: 20

[SOLVED] optimus-manager ERROR : cannot get current display manager na

Trying to configure optimus-manager. When I run optimus-manager --status I get

Current GPU mode : intel
GPU mode requested for next login : no change
GPU at startup : intel
Temporary config path: no

I would like to configure it to switch to the nvidia gpu when needed, as per https://github.com/Askannz/optimus-mana … nt-options
But when I just try to switch to the nvidia gpu to test that it works using optimus-manager --switch nvidia I get the following error:

ERROR : cannot get current display manager name : No display-manager.service file found
You are about to switch GPUs. This will forcibly close all graphical sessions and all your applications WILL CLOSE.
(you can pass the --no-confirm option to disable this warning)
Continue ? (y/N)

And I'm really not sure what to do.

Last edited by RichKat (2020-10-06 15:23:53)

Offline

#2 2020-10-02 14:23:33

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,889

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

Using optimus-manager switch requires special configuration.

If you're using sddm, lightdm or gdm it should work, For other display managers / methods to startx extra steps are needed.
Check https://github.com/Askannz/optimus-manager and the faq sections the first paragraph links to.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2020-10-02 14:31:21

RichKat
Member
Registered: 2020-08-15
Posts: 20

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

Yes, I'm using bspwm, but the FAQ sections just say to make sure it starts and cloases with X, nothing about configuring to make the switch command work, I don't think?

Offline

#4 2020-10-02 14:39:21

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,889

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

You need to log out , make the switch, then re-login .

https://github.com/Askannz/optimus-mana … logged-out states that this should be done automagickally by optimus-manager for bspwm .
If that doesn't work for you, you may have to create a new issue on github.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2020-10-02 14:49:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,102

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

How are you making sure it starts with X? Post your .xinitrc in doubt and make sure you've read: https://wiki.archlinux.org/index.php/Xinit#xinitrc and https://wiki.archlinux.org/index.php/Xinit#xserverrc

Offline

#6 2020-10-02 18:08:31

RichKat
Member
Registered: 2020-08-15
Posts: 20

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

It does log me out and allow me to log back in, but when I run optimus-manager --status I get

A GPU switch from intel to nvidia is pending.
Log out and log back in to apply.

Optimus Manager (Client) version 1.3

Current GPU mode : intel
GPU mode requested for next login : nvidia
GPU at startup : intel
Temporary config path: no

If I su "username" nothing changes. If I restart my computer it goes back to

 Current GPU mode : intel
GPU mode requested for next login : no change
GPU at startup : intel
Temporary config path: no

Am I logging in and out wrong?

My xinitrc looks like this:

~/.fehbg &
/usr/bin/prime-offload &
picom & 
sxhkd &
thunar --daemon &
polybar bar &
bluetoothctl power on &
devmon --info-on-mount &
exec bspwm

The github page says I need to make sure that /usr/bin/prime-switch is run after log out, which I'm still figuring out, so that's not in the xinitrc, if it's meant to be.

Offline

#7 2020-10-03 09:51:18

RichKat
Member
Registered: 2020-08-15
Posts: 20

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

Okay, I am now able to switch GPU's, I added sudo /usr/bin/prime-switch to the end of my xinitrc and removed the exec before the bspwm, so now the switch can happen after log out,

Unfortunately,

When I try to switch to the nvidia GPU the result is many small versions of my desktop tiled around my screen, only the top left one of which I can use. Polybar also vanishes. When I switch desktops it's the top left desktop that changes, not any of the others. Why could this be happening? I'll try to post a screenshot.

Edit, I got a screenshot:
https://imgur.com/a/zzyj98I

Last edited by RichKat (2020-10-03 10:15:47)

Offline

#8 2020-10-03 11:45:00

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,889

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

Your xinitrc is  a mess.

You didn't start with  a copy of /etc/X11/xinit/xinitrc , see https://wiki.archlinux.org/index.php/Xinit

Some commands in it shouldn't even be in xinitrc at all.

example :
polybar wiki page makes clear that bspwn users should start polybar through an entry in bspwmrc.
https://wiki.archlinux.org/index.php/Polybar#bspwm
THe bspwm wiki page mentions the same thing.

example:
sxhkd comes with a systemd user service file, that should be enabled by systemctl.
https://wiki.archlinux.org/index.php/Sxhkd#Usage

Fix your xinitrc.

Last edited by Lone_Wolf (2020-10-03 11:45:33)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2020-10-03 12:48:27

RichKat
Member
Registered: 2020-08-15
Posts: 20

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

Ah, I was afraid that would be the case. I'll get on that directly. Still, I don't think that will fix the current issue, so I'm still looking for a solution to that

Offline

#10 2020-10-04 11:31:11

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,889

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

The reason optimus-manager --switch forces a logout is to stop all processes using the gpu before the switch is made.

Almost all lines in your xinitrc end with a & , which tells your shell to run those commands in the background forever.
When you are logging out user processes started with & aren't killed or stopped (on archlinux, other distros may behave differently) .

Some of the commands do need the & , most don't .
Fix your xinitrc , post it so forum users can verify if it is correct.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#11 2020-10-06 15:20:46

RichKat
Member
Registered: 2020-08-15
Posts: 20

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

First off, thank you very much for your help, I would never have thought that it was my xinitrc that was causing issues.

Here it is at present:

# Some important commands
/usr/bin/prime-offload  
picom & 

# Assorted commands
~/.fehbg &
thunar --daemon &
bluetoothctl power on &
devmon --info-on-mount &

# Start bspwm
bspwm

sudo /usr/bin/prime-switch

I know there are still probably too many &'s, but it's better; most importantly, optimus-manager --switch now works without issue!
I'm currently trying to figure out which of these need &'s and which don't. Before I thought & just meant "go on to the next line" hmm

Is there anything else I need to do to improve my xinitrc?

Offline

#12 2020-10-07 12:05:04

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,889

Re: [SOLVED] optimus-manager ERROR : cannot get current display manager na

look at /etc/X11/xinit/xinitrc .

The if-fi block just above the twm line is necessary to ensure scripts in /etc/X11/xinit/xinitrc.d folder are executed .
one of them has to do with dbus activation.

fehbg does need the & .

If the bluetootctl command is there to ensure bluetooth is powered on, there's  a simple method to enable it systemwide.
https://wiki.archlinux.org/index.php/Bl … after_boot


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB