You are not logged in.

#1 2020-12-23 02:18:28

erfanjoker
Member
From: Tabriz / Iran
Registered: 2017-03-26
Posts: 174
Website

[SOLVED] Can't start i3wm after setting Nvidia as main GPU

Hi,
In continue to this topic, I was able to set Nvidia as my main GPU and I'm able to succesfully use GNOME with the prefered settings (using GDM)
But the problem is when i try to log into i3wm using GDM, I get a black screen and my VGA external monitor gets disconnected (like it's shutdown and recieves no input) and my laptop screen is just black (total black cause it's turned off, not the black with backlight)
In this step, i am able to access other TTY's and system is working properly, so it's not a HW issue, maybe a misconfiguration or etc, here is my journal : https://mega.nz/file/izRX2SDJ#iI-Ws5EYq … 1t6Adeisxc

I also have to mention that after Nvidia configurations, I was getting a fake VGA display detected in my system which was set as my primary display, I managed to disable it in gnome display settings in DE Level and is working fine, also in Startup Manager Level like GDM, i used this workaround by turning it off :

^^>>> cat /etc/X11/xorg.conf.d/11-monitor.conf                     05:45:33 
Section "Monitor"
	Identifier "VGA-0"
	Option	"Ignore"	"True"
EndSection

And here is my .xsession file :

^^>>> cat ~/.xsession                                              05:28:19 
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

My guess is it has something to do with the /etc/X11/xorg.conf.d/11-monitor.conf as it's turning of the VGA-0,
I don't know what mechanism does i3wm use for handling displays, but i was not really able to save my monitors config in i3wm ever, I always had issues and used to do a config after reboot using arandr.

Last edited by erfanjoker (2020-12-24 09:25:59)

Offline

#2 2020-12-23 08:51:22

seth
Member
Registered: 2012-09-03
Posts: 57,289

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

Post your i3 config.
I'm not sure whether GDM executes ~/.xsession

Edit, and please use code tags or ix.io, not some mega drive where one has to download files

Last edited by seth (2020-12-23 08:51:57)

Offline

#3 2020-12-23 09:55:48

Archlin
Member
Registered: 2018-05-09
Posts: 67

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

As an example a part of my config that has 3 monitor support
You can use this as an guideline

################### set output ######################

# set output monitors

set $mon1 DVI-I-1 # main screen Samsung
set $mon2 DVI-D-0 # second screen LG
set $mon3 HDMI-0 # tv screen


################### set workspaces ###################

        set $wsp1 "1.?"
        set $wsp2 "2.?"
        set $wsp3 "3.✉️"
        set $wsp4 "4.?"
        set $wsp5 "5.?"
        set $wsp6 "6.?"
        set $wsp7 "7.?"
        set $wsp8 "8.?"
        set $wsp9 "9.?"
        set $wsp10 "10.?"
    	set $wsp11 "11,?"

 #     set $wsp1 "1"
 #     set $wsp2 "2"
 #     set $wsp3 "3"
 #     set $wsp4 "4"
 #     set $wsp5 "5"
 #     set $wsp6 "6"
 #     set $wsp7 "7"
 #     set $wsp8 "8"
 #     set $wsp9 "9"
 #     set $wsp10 "10"
 #  	set $wsp11 "11"

        workspace $wsp1 output $mon1
        workspace $wsp2 output $mon1
        workspace $wsp3 output $mon1
        workspace $wsp4 output $mon1
        workspace $wsp5 output $mon1
        workspace $wsp6 output $mon1
        workspace $wsp7 output $mon1
        workspace $wsp8 output $mon1
        workspace $wsp9 output $mon1
        workspace $wsp10 output $mon3
        workspace $wsp11 output $mon2


################### keybinding to workspace ###################

        bindsym $mod+1 workspace $wsp1
        bindsym $mod+2 workspace $wsp2
        bindsym $mod+3 workspace $wsp3
        bindsym $mod+4 workspace $wsp4
        bindsym $mod+5 workspace $wsp5
        bindsym $mod+6 workspace $wsp6
        bindsym $mod+7 workspace $wsp7
        bindsym $mod+8 workspace $wsp8
        bindsym $mod+9 workspace $wsp9
        bindsym $mod+0 workspace $wsp10
        bindsym $alt+1 workspace $wsp11



#################### move focused window to workspace ###################

        bindsym $mod+Shift+1 move container to workspace $wsp1
        bindsym $mod+Shift+2 move container to workspace $wsp2
        bindsym $mod+Shift+3 move container to workspace $wsp3
        bindsym $mod+Shift+4 move container to workspace $wsp4
        bindsym $mod+Shift+5 move container to workspace $wsp5
        bindsym $mod+Shift+6 move container to workspace $wsp6
        bindsym $mod+Shift+7 move container to workspace $wsp7
        bindsym $mod+Shift+8 move container to workspace $wsp8
        bindsym $mod+Shift+9 move container to workspace $wsp9
        bindsym $mod+Shift+0 move container to workspace $wsp10
        bindsym $alt+Shift+1 move container to workspace $wsp11

#################### Example to load XrandR  settings in i3 ###################

       exec xrandr --output DVI-I-1 --primary --auto --output HDMI-0 --auto --left-of DVI-I-1 --output DVI-D-0 --auto --right-of DVI-I-1

     

Last edited by Archlin (2020-12-23 10:57:52)

Offline

#4 2020-12-23 13:44:53

erfanjoker
Member
From: Tabriz / Iran
Registered: 2017-03-26
Posts: 174
Website

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

seth wrote:

Post your i3 config.
I'm not sure whether GDM executes ~/.xsession

Edit, and please use code tags or ix.io, not some mega drive where one has to download files

Hi,
Here is file ~/.config/i3/config : http://ix.io/2Jgm

Offline

#5 2020-12-23 13:51:49

erfanjoker
Member
From: Tabriz / Iran
Registered: 2017-03-26
Posts: 174
Website

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

Archlin wrote:

As an example a part of my config that has 3 monitor support
You can use this as an guideline

################### set output ######################

# set output monitors

set $mon1 DVI-I-1 # main screen Samsung
set $mon2 DVI-D-0 # second screen LG
set $mon3 HDMI-0 # tv screen


################### set workspaces ###################

        set $wsp1 "1.?"
        set $wsp2 "2.?"
        set $wsp3 "3.✉️"
        set $wsp4 "4.?"
        set $wsp5 "5.?"
        set $wsp6 "6.?"
        set $wsp7 "7.?"
        set $wsp8 "8.?"
        set $wsp9 "9.?"
        set $wsp10 "10.?"
    	set $wsp11 "11,?"

 #     set $wsp1 "1"
 #     set $wsp2 "2"
 #     set $wsp3 "3"
 #     set $wsp4 "4"
 #     set $wsp5 "5"
 #     set $wsp6 "6"
 #     set $wsp7 "7"
 #     set $wsp8 "8"
 #     set $wsp9 "9"
 #     set $wsp10 "10"
 #  	set $wsp11 "11"

        workspace $wsp1 output $mon1
        workspace $wsp2 output $mon1
        workspace $wsp3 output $mon1
        workspace $wsp4 output $mon1
        workspace $wsp5 output $mon1
        workspace $wsp6 output $mon1
        workspace $wsp7 output $mon1
        workspace $wsp8 output $mon1
        workspace $wsp9 output $mon1
        workspace $wsp10 output $mon3
        workspace $wsp11 output $mon2


################### keybinding to workspace ###################

        bindsym $mod+1 workspace $wsp1
        bindsym $mod+2 workspace $wsp2
        bindsym $mod+3 workspace $wsp3
        bindsym $mod+4 workspace $wsp4
        bindsym $mod+5 workspace $wsp5
        bindsym $mod+6 workspace $wsp6
        bindsym $mod+7 workspace $wsp7
        bindsym $mod+8 workspace $wsp8
        bindsym $mod+9 workspace $wsp9
        bindsym $mod+0 workspace $wsp10
        bindsym $alt+1 workspace $wsp11



#################### move focused window to workspace ###################

        bindsym $mod+Shift+1 move container to workspace $wsp1
        bindsym $mod+Shift+2 move container to workspace $wsp2
        bindsym $mod+Shift+3 move container to workspace $wsp3
        bindsym $mod+Shift+4 move container to workspace $wsp4
        bindsym $mod+Shift+5 move container to workspace $wsp5
        bindsym $mod+Shift+6 move container to workspace $wsp6
        bindsym $mod+Shift+7 move container to workspace $wsp7
        bindsym $mod+Shift+8 move container to workspace $wsp8
        bindsym $mod+Shift+9 move container to workspace $wsp9
        bindsym $mod+Shift+0 move container to workspace $wsp10
        bindsym $alt+Shift+1 move container to workspace $wsp11

#################### Example to load XrandR  settings in i3 ###################

       exec xrandr --output DVI-I-1 --primary --auto --output HDMI-0 --auto --left-of DVI-I-1 --output DVI-D-0 --auto --right-of DVI-I-1

     

Thanks,  but for some reasons my config file is getting re-written everytime i boot ! Thus i have never tried editing config file for startup stuffs, as i always add keyboard layout by using setxkbmap manually, i always added this to config file and on the next reboot it was gone !

Is there anyway convert arandr config to xrandr command ? or force xrandr to use arandr config ?

Offline

#6 2020-12-23 15:01:14

Archlin
Member
Registered: 2018-05-09
Posts: 67

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

That your config gets overwritten (every time) when you reboot that's kinda odd.
I must confess I never seen such a behavior but it seems to me to get that fixed at first.

I also never used arandr but is is not a graphical front end for the CLI xrandr?

Offline

#7 2020-12-23 15:45:06

erfanjoker
Member
From: Tabriz / Iran
Registered: 2017-03-26
Posts: 174
Website

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

Archlin wrote:

That your config gets overwritten (every time) when you reboot that's kinda odd.
I must confess I never seen such a behavior but it seems to me to get that fixed at first.

I also never used arandr but is is not a graphical front end for the CLI xrandr?

I would like to fix it, and im planning to start a new thread for that, but first i have to get it to work properly on my screen
arandr is GUI for xrandr, but its changes are instant as it applies via running command, it also can generate config file but not at the default config directory of xrandr, It just generates bash script and needs to run at startup (I prefer config file, to startup exec command)

Last edited by erfanjoker (2020-12-23 15:47:12)

Offline

#8 2020-12-23 15:46:01

seth
Member
Registered: 2012-09-03
Posts: 57,289

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

posted i3 config wrote:

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.

Do you use some overlay FS for your $HOME?

About the i3 config, there's no randr call in that.
Since I don't think that GDM cares about ~/.xsession, add a PreSession script to setup the randr config, https://help.gnome.org/admin/gdm/stable … on.html.en
This will be required because GDM launches a second X11 server for the session.

Alternatively just drop GDM…

Offline

#9 2020-12-23 16:05:26

erfanjoker
Member
From: Tabriz / Iran
Registered: 2017-03-26
Posts: 174
Website

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

seth wrote:

Alternatively just drop GDM…

I disabled GDM service and enabled Lightdm Rebooted and oops, the same as i3wm, when it enters GUI, it just turns off monitors and uses it's dream fake monitor, the thing is GDM and Gnome may use something other than system default monitor config

Here is my correct xrandr config :

xrandr --output LVDS-1-1 --mode 1366x768 --pos 1920x0 --rotate normal --output VGA-1-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-1-1 --off --output DP-1-1 --off

Where could i just add this command to get Lightdm, or i3wm working ?
I placed it in i3wm config file and set its permission to 444 so it wont get overwritten, then logged into i3, and the same result, like it is not executing this config file, or sth else

Thats why i dont really like executing xrandr command and prefer a global config file

Offline

#10 2020-12-23 16:21:33

seth
Member
Registered: 2012-09-03
Posts: 57,289

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

Lightdm Rebooted and oops, the same as i3wm, when it enters GUI, it just turns off monitors and uses it's dream fake monitor

That part has nothing to do w/ GDM and I would eye more sth. like xinit/startx…
If I should name a DM that's even worse than GDM it'd likely be lightdm…

Where could i just add this command to get Lightdm … working ?

https://wiki.archlinux.org/index.php/Li … ng_monitor

I placed it in i3wm config file

Placed it "how"?

Thats why i dont really like executing xrandr command and prefer a global config file

You can just add those outputs w/ the desired config to your /etc/X11/xorg.conf.d/11-monitor.conf ?

man xorg.conf

Offline

#11 2020-12-24 09:25:35

erfanjoker
Member
From: Tabriz / Iran
Registered: 2017-03-26
Posts: 174
Website

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

seth wrote:

Lightdm Rebooted and oops, the same as i3wm, when it enters GUI, it just turns off monitors and uses it's dream fake monitor

That part has nothing to do w/ GDM and I would eye more sth. like xinit/startx…
If I should name a DM that's even worse than GDM it'd likely be lightdm…

Where could i just add this command to get Lightdm … working ?

https://wiki.archlinux.org/index.php/Li … ng_monitor

I placed it in i3wm config file

Placed it "how"?

Thats why i dont really like executing xrandr command and prefer a global config file

You can just add those outputs w/ the desired config to your /etc/X11/xorg.conf.d/11-monitor.conf ?

man xorg.conf

Thanks for answering, I added the command directly to i3wm config file, then i figured out i have to use "exec Command" and it did the trick

Offline

#12 2020-12-24 13:16:34

Archlin
Member
Registered: 2018-05-09
Posts: 67

Re: [SOLVED] Can't start i3wm after setting Nvidia as main GPU

erfanjoker wrote:

Thanks for answering, I added the command directly to i3wm config file, then i figured out i have to use "exec Command" and it did the trick

Glad it worked smile

Guess you did not see the last line in my example which should have pointed that out.

Offline

Board footer

Powered by FluxBB