bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
MIT License
1.22k stars 62 forks source link

Sddm fails to open in hybrid and nvidia mode. #71

Open candyclaws opened 1 year ago

candyclaws commented 1 year ago

I am using void linux, and it began after installing and switching to integrated for the first time. Now I am completely unable to use my nvidia gpu. I have tried reinstalling all of my nvidia drivers and dkms, I have checked all of the blacklists, and while I can access my nvidia gpu in other modes, sddm will not launch.

bayasdev commented 1 year ago

Have you tried with --reset-sddm?

candyclaws commented 1 year ago

I tried --reset-sddm, I tried deleting all the files it created, I tried everything I could think of to get it working so in the end I just backed up my home folder and reinstalled, maybe it's a void linux thing, they do seem to do things different than other distros

gavsiu commented 11 months ago

Is SDDM causing a black screen with frozen text cursor (not blinking) on boot?

I used to be able to use envycontrol on my previous system install without a display manager or desktop environment. Now with SDDM and Plasma 5, I can't use any of integrated/hybrid/nvidia. It just freezes on boot. I have to chroot and run envycontrol --reset to be able to boot again. Not sure if SDDM is causing this, but maybe one of you know.

bayasdev commented 11 months ago

Is SDDM causing a black screen with frozen text cursor (not blinking) on boot?

I used to be able to use envycontrol on my previous system install without a display manager or desktop environment. Now with SDDM and Plasma 5, I can't use any of integrated/hybrid/nvidia. It just freezes on boot. I have to chroot and run envycontrol --reset to be able to boot again. Not sure if SDDM is causing this, but maybe one of you know.

What distro are you using?

gavsiu commented 11 months ago

Arch Linux.

bayasdev commented 11 months ago

@gavsiu can you switch to Nvidia mode using --verbose flag?

PD: you can --reset again before rebooting but I want to see the output

gavsiu commented 11 months ago
Switching to nvidia mode
Enable ForceCompositionPipeline: False
Enable Coolbits: False
Successfully enabled nvidia-persistenced.service
INFO: Found Nvidia GPU at 01:00.0
INFO: Found Intel iGPU
INFO: Created file /etc/X11/xorg.conf
# Automatically generated by EnvyControl

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

INFO: Created file /etc/modprobe.d/nvidia.conf
# Automatically generated by EnvyControl

options nvidia-drm modeset=1
options nvidia NVreg_UsePageAttributeTable=1 NVreg_InitializeSystemMemoryAllocations=0

INFO: Found sddm Display Manager
INFO: Creating Xsetup backup
INFO: Created file /usr/share/sddm/scripts/Xsetup.bak
#!/bin/sh
# Xsetup - run as root before the login dialog appears

INFO: Created file /usr/share/sddm/scripts/Xsetup
#!/bin/sh
# Automatically generated by EnvyControl

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

INFO: Added execution privilege to file /usr/share/sddm/scripts/Xsetup
Operation completed successfully
Please reboot your computer for changes to take effect!
bayasdev commented 11 months ago

What happens if you remove this line from /etc/modprobe.d/nvidia.conf ?

options nvidia NVreg_UsePageAttributeTable=1 NVreg_InitializeSystemMemoryAllocations=0
gavsiu commented 11 months ago

I also have this in my /etc/modprobe.d/nvidia-power-management.conf

options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp NVreg_DynamicPowerManagement=0x02

Does this need to be removed?

bayasdev commented 11 months ago

I also have this in my /etc/modprobe.d/nvidia-power-management.conf

options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp NVreg_DynamicPowerManagement=0x02

Does this need to be removed?

Try to rename it to .bak instead of deleting it, I'm just trying to test something

gavsiu commented 11 months ago

Renamed to .bak, deleted line from nvidia.conf. Still froze the same way.