Some background first. I was trying to reduce the power consumption in xubuntu in my laptop , which led me on a trail towards finding which GPU was being used for rendering the display. ( My laptop had ATI integrated graphics + NVIDIA dedicated graphics ). I must have done something on the way, which messed with Xorg or something. ( I tried prime-select, prime-switch and prime-offload ), all of which didn't seem to do much.
Reason for my suspicion
$ nvidia-smi
Wed Dec 22 13:07:08 2021
+---------------------------------------------+
| NVIDIA-SMI 450.102.04 Driver Version: 450.102.04 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 1650 Off | 00000000:01:00.0 Off | N/A |
| N/A 44C P8 2W / N/A | 6MiB / 3911MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+---------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1017 G /usr/lib/xorg/Xorg 4MiB |
+---------------------------------------------+
When i booted next time, the screen was stuck before the login in a black screen.
I was able to login via the tty. So i googled the issue and found this question, where there was a suggestion to remove xorg.conf was made. Removing the xorg.conf took me past that screen to the login screen, which I was able to pass, but now the GUI gets stuck immediately after login. ( I can see only the xfce panel, and the icons werent getting rendered ). A weird thing i noticed is, eventhough it was stuck, when i click the firefox button in the panel, the cursor switches to a loading cursor for sometime, and i could see firefox running through top.
I tried creating a new xorg.conf file using X -configure
( from here ), but the command kept saying the number of displays in the config doesnt match the displays available, while generating this config
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "built-ins"
EndSection
Section "Module"
Load "glx"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "Accel" # [<bool>]
#Option "SWcursor" # [<bool>]
#Option "EnablePageFlip" # [<bool>]
#Option "SubPixelOrder" # [<str>]
#Option "ZaphodHeads" # <str>
#Option "AccelMethod" # <str>
#Option "DRI3" # [<bool>]
#Option "DRI" # <i>
#Option "ShadowPrimary" # [<bool>]
#Option "TearFree" # [<bool>]
#Option "DeleteUnusedDP12Displays" # [<bool>]
#Option "VariableRefresh" # [<bool>]
Identifier "Card0"
Driver "amdgpu"
BusID "PCI:4:0:0"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "SWcursor" # [<bool>]
#Option "HWcursor" # [<bool>]
#Option "NoAccel" # [<bool>]
#Option "ShadowFB" # [<bool>]
#Option "VideoKey" # <i>
#Option "WrappedFB" # [<bool>]
#Option "GLXVBlank" # [<bool>]
#Option "ZaphodHeads" # <str>
#Option "PageFlip" # [<bool>]
#Option "SwapLimit" # <i>
#Option "AsyncUTSDFS" # [<bool>]
#Option "AccelMethod" # <str>
#Option "DRI" # <i>
Identifier "Card1"
Driver "nouveau"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
Section "Screen"
Identifier "Screen1"
Device "Card1"
Monitor "Monitor1"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
Renaming this file as xorg.conf and placing it in /etc/X11/xorg.conf didnt help. Removing Xauthority and ~/.xinitrc also didnt help. So i tried to figure out what this config does, and noticed it is creating 2 displays unnecessarily even if i have only one. So i removed some parts, and made the amdgpu driver drive the only display i have. No improvement although, i now noticed the Xorg process disappeared from nvidia-smi
output.
On the suggestion from here and here, i tried running startxfce4 after stopping lightdm, which now brought me to the GUI. But rebooting brought me square 1.
Tried making the active_monitor=0
in the greeter.conf
file. Didnt help. link
Then tried installing slim and xdm. The GUI starts working normally. But a few annoying issues crop up. logging in through slim, makes me enter the login password 3 times after login for wifi scanning and some other stuff, and the shutdown and reboot buttons are greyed out. In xdm, the password is asked once after some 10 minutes to unlock some keyring, before which firefox doesnt allow me to browse.
Figured out the slim password issue is due to the /sbin and /usr/sbin not being part of its PATH.
Realizing i am now relatively safe, I tried purging lightdm and lightdm-gtk-greeter, which i initially hesitated to do, since it insisted on removing xubuntu-core
. Didnt help. Same issue happens.
I would like to get back my beloved lightdm back. Any help on this would be greatly appreciated. Thank you.