This forum has been archived. All content is frozen. Please use KDE Discuss instead.

SDDM Runs Xsetup on System Shutdown After Switching GPU's

Tags: None
(comma "," separated)
linesma
Registered Member
Posts
1
Karma
0
OS
I hope this is the correct place to post this. I am using an Arch install with KDE on my Asus FX504G laptop. This laptop is one of those "wonderful" nVidia/ Intel solutions. In order to have my GPU's work properly, I use a program called "Optimus-Switch". https://github.com/dglt1/optimus-switch-sddm It allows me to "switch" which GPU I want to use.

The problem I am having is when I switch to the Intel iGPU from the nVidia GPU. When in Intel "mode", it uses ACPI-Call to power down the nVidia GPU completely. In order to do this, Optimus- Switch changes the standard Xsetup file and adds in the needed lines for ACPI-Call to disable the nVidia GPU. After I run the script to change to Intel, I have to reboot the laptop. This is when the problem happens. During the shutdown sequence, two instances of SDDM will run and subsequently hang for 2 minutes. Once these two instances of SDDM close, the shutdown process continues until right before the SystemD would shut the system down. SystemD displays an error saying that it can't shut the system down because Xsetup is being run by SDDM. I then have to manually shutdown the laptop by using the power button.

After manually shutting the system down, it will start without any problems into "Intel" mode. The system has no problems shutting down from this point. The system also has no issues restarting when switching from Intel mode to nVidia mode.

It seems that the ACPI-Call information in Xsetup is causing the issue. One can't power down a GPU if it is in use. Is it normal for SDDM to run Xsetup when the system shuts down? If so, how can one run the ACPI-Call commands when the system starts without having them in Xsetup?

Here is the modified Xsetup file with the ACPI-Call information.

Code: Select all
#!/bin/sh

#this script is run as a display setup script
#that replaces the one used by nvidia/prime.
##
#this powers-down/disables the nvidia dGPU and
#removes it from /sys/bus/pce/devices
#for the current boot. this is reset after reboot.
# PLEASE READ BELOW TO ENABLE THIS

xrandr --auto

#This ensures that LightDM doesn't fail after locking the screen or logging out
#edit "0000:01:00.0" to match your bus id if it's different.

if [ -d "/sys/bus/pci/devices/0000:01:00.0" ]
then

  echo 'auto' > '/sys/bus/pci/devices/0000:01:00.0/power/control'  #adjust busid if needed

fi



#to find out what acpi_call disables your nvidia gpu,
#run this command
#
#` sudo /usr/share/acpi_call/examples/turn_off_gpu.sh `
#
#and see which acpi_call is returned as "works!" and then edit line 38 to match if needed.
#default BusID is set to 0000:01:00.0 (syntax is important)
#be sure to edit lines 16,19,36,38,39 to match your BusID and working acpi_call if needed
#then uncomment lines 38,39


if [ -d "/sys/bus/pci/devices/0000:01:00.0" ]
then
  echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call
  echo -n 1 > '/sys/bus/pci/devices/0000:01:00.0/remove'

fi


Please let me know if any further information is required and I will be happy to provide them.

Thanks!


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]