openSUSE / SUSEPrime

Provide nvidia-prime like package for openSUSE
65 stars 11 forks source link

[Tumbleweed] prime-select 0.7.1 not working #31

Closed DevDorrejo closed 5 years ago

DevDorrejo commented 5 years ago

hello, when i install the prime-select, none of the listed files on the github are on the folder and neither the .service files, and when try use prime-select got error and false positive:

TW-WEDC:~ # prime-select nvidia
ERROR: Unable to query GPU information
TW-WEDC:~ # prime-select nvidia
nvidia driver already in use!
TW-WEDC:~ # prime-select intel
ERROR: Unable to query GPU information
TW-WEDC:~ # prime-select intel
intel driver already in use!
TW-WEDC:~ #
DevDorrejo commented 5 years ago

i will do a clean install, have 1 year and i did too much config

sndirsch commented 5 years ago

Seems your nvidia driver installation failed or is broken meanwhile, so 'nvidia-xconfig --query-gpu-info' fails, so we cannot find the required information for PCI BusID.

For some reason the command apparently still returns 0 (I cannot reproduce this even on a non-nvidia machine), so our check if the command is successful doesn't cover this behaviour.

I can improve the check so it also covers an empty string (assuming it is empty!), but this won't fix your nvidia driver installation of course.

sndirsch commented 5 years ago

diff --git a/prime-select.sh b/prime-select.sh index 045db5d..63d868f 100755 --- a/prime-select.sh +++ b/prime-select.sh @@ -166,7 +166,7 @@ EOF ` gpu_info=$(nvidia-xconfig --query-gpu-info) # This may easily fail, if no NVIDIA kernel module is available or alike - if [ $? -ne 0 ]; then + if [ $? -ne 0 -o "$gpu_info" == "" ]; then logging "PCI BusID of NVIDIA card could not be detected!" exit 1 fi @@ -223,7 +223,7 @@ function common_set_intel { gpu_info=$(nvidia-xconfig --query-gpu-info) # This may easily fail, if no NVIDIA kernel module is available or alike - if [ $? -ne 0 ]; then + if [ $? -ne 0 -o "$gpu_info" == "" ]; then logging "PCI BusID of NVIDIA card could not be detected!" exit 1 fi`

sndirsch commented 5 years ago

If this helps to fix the behaviour of the script (I doubt!) I can add this patch, but first you should reset your config by running 'prime-select unset' (which doesn't fix your nvidia driver installation of course).

simopil commented 5 years ago

I've got the same error during boot. I think it caused by bbswitch that turns off nvidia card during boot and the "nvidia offload" setting in the intel xorgfile. Edit: resolved without setting bbswitch to keep power state nvidia during boot (edit /etc/modprobe.d/09-nvidia-modprobe-bbswitch-G04.conf, set load and unload to "-1", then do "sudo mkinitrd")

sndirsch commented 5 years ago

@simopil But then the switch should fail and script should bail out with exit 1. It apparently does not. That's what I don't understand here.

simopil commented 5 years ago

The error for me was during boot and not during switch, so I resolved it with preventing bbswitch to switching off nvidia itself during boot (and before prime-select execution)

sndirsch commented 5 years ago

@simopil OK. If this required a patch against suse-prime, could you do a pull request, please? Thanks!

DevDorrejo commented 5 years ago

hello, i did a fresh install and the problem was solved, i found before the fresh install, that the folder /etc/X11/xorg.conf.d was empty, and gave bad perfomance on the nvidia and on the intel, i will close this issue.

sndirsch commented 5 years ago

Ok. Thanks for the update!