Hello community, here is the log from the commit of package suse-prime for openSUSE:Factory checked in at 2019-10-08 19:59:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/suse-prime (Old) and /work/SRC/openSUSE:Factory/.suse-prime.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "suse-prime" Tue Oct 8 19:59:56 2019 rev:14 rq:736082 version:0.7.2 Changes: -------- --- /work/SRC/openSUSE:Factory/suse-prime/suse-prime.changes 2019-10-07 14:13:55.822920393 +0200 +++ /work/SRC/openSUSE:Factory/.suse-prime.new.2352/suse-prime.changes 2019-10-08 19:59:58.427832054 +0200 @@ -1,0 +2,59 @@ +Tue Oct 8 11:51:23 UTC 2019 - Stefan Dirsch <[email protected]> + +- Update to version 0.7.2 with various improvements and fixes + * Full support to nvidia prime offloading without service or + with bbswitch with service disabled + * Distinction between "service disabled" (bbswitch package) + and "service not installed" + * Fixed bug with bbswitch and service enabled that returns i + "PCI BusID of NVIDIA card could not be detected" + * Now when NVIDIA is OFF, intel xorg config file has ai + commented "nvidia prime offloading" section + * Mention that offloading needs service disabled + * Corrected intentation in some sections +- supersedes the following patches: + * 0001-Removed-exit-1-error-from-common-set-intel-because-d.patch + * 0002-Various-improvements-and-fixes.patch + * 0003-Merged-commit-https-github.com-openSUSE-SUSEPrime-pu.patch + +------------------------------------------------------------------- +Tue Oct 8 10:23:37 UTC 2019 - Stefan Dirsch <[email protected]> + +- 0001-Removed-exit-1-error-from-common-set-intel-because-d.patch, + * Removed "exit 1" error from "common set intel" because during + boot and nvidia card off by default in bbswitch (load_state=0) + crashes service +- 0002-Various-improvements-and-fixes.patch + * Various improvements and fixes + + Full support to nvidia prime offloading without service or with + bbswitch with service disabled + + Distinction between "service disabled" (bbswitch package) and + "service not installed" + + Fixed bug with bbswitch and service enabled that returns + "PCI BusID of NVIDIA card could not be detected" + + Now when NVIDIA is OFF, intel xorg config file has a commented + "nvidia prime offloading" section + + Mention that offloading needs service disabled + + Corrected intentation in some sections +- 0003-Merged-commit-https-github.com-openSUSE-SUSEPrime-pu.patch + * supersedes 0001-Fix-intel-configs-if-no-NVIDIA-kernel-module-is-avai.patch + +------------------------------------------------------------------- +Mon Oct 7 19:40:15 UTC 2019 - Stefan Dirsch <[email protected]> + +- fix build on distributions, where %{?regenerate_initrd_post} + doesn't exist yet +- %preun: 'prime-select unset' is supposed to fail during + package installation test during build, therefore don't + let it fail via adding "|| true" to the command + +------------------------------------------------------------------- +Mon Oct 7 13:52:34 UTC 2019 - Stefan Dirsch <[email protected]> + +- 0001-Fix-intel-configs-if-no-NVIDIA-kernel-module-is-avai.patch + * Move additional nvidia X device section needed for NVIDIA's Prime + Render Offload mode to an extra xorg.conf.d snippet. Add this only + to intel X configs, if NVIDIA's PCI BusId can be detected. +- add xorg-nvidia-prime-render-offload.conf X snippet to /etc/prime + +------------------------------------------------------------------- Old: ---- SUSEPrime-0.7.1.tar.gz New: ---- SUSEPrime-0.7.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ suse-prime.spec ++++++ --- /var/tmp/diff_new_pack.NiZu8r/_old 2019-10-08 19:59:59.663828835 +0200 +++ /var/tmp/diff_new_pack.NiZu8r/_new 2019-10-08 19:59:59.719828690 +0200 @@ -17,7 +17,7 @@ Name: suse-prime -Version: 0.7.1 +Version: 0.7.2 Release: 0 Summary: GPU (nvidia/intel) selection for NVIDIA optimus laptops License: SUSE-Public-Domain @@ -62,6 +62,7 @@ install -m 0644 xorg-intel.conf %{buildroot}%{_sysconfdir}/prime/ install -m 0644 xorg-intel-intel.conf %{buildroot}%{_sysconfdir}/prime/ install -m 0644 xorg-nvidia.conf %{buildroot}%{_sysconfdir}/prime/ +install -m 0644 xorg-nvidia-prime-render-offload.conf %{buildroot}%{_sysconfdir}/prime/ mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d install -m 0644 09-nvidia-modprobe-bbswitch-G04.conf %{buildroot}%{_sysconfdir}/modprobe.d/ install -m 0644 09-nvidia-modprobe-pm-G05.conf %{buildroot}%{_sysconfdir}/modprobe.d/ @@ -80,11 +81,12 @@ if [ "$1" -eq 0 ]; then # cleanup before uninstalling the package completely export PATH=$PATH:/usr/sbin - %{_sbindir}/prime-select unset + %{_sbindir}/prime-select unset || true fi %postun if [ "$1" -eq 0 ]; then + true %{?regenerate_initrd_post} fi @@ -129,6 +131,7 @@ %config %{_sysconfdir}/prime/xorg-intel.conf %config %{_sysconfdir}/prime/xorg-intel-intel.conf %config %{_sysconfdir}/prime/xorg-nvidia.conf +%config %{_sysconfdir}/prime/xorg-nvidia-prime-render-offload.conf %config(noreplace) %{_sysconfdir}/prime/current_type %{_sbindir}/prime-select %config %{_sysconfdir}/modprobe.d/09-nvidia-modprobe-pm-G05.conf @@ -141,6 +144,7 @@ %config %{_sysconfdir}/prime/xorg-intel.conf %config %{_sysconfdir}/prime/xorg-intel-intel.conf %config %{_sysconfdir}/prime/xorg-nvidia.conf +%config %{_sysconfdir}/prime/xorg-nvidia-prime-render-offload.conf %config(noreplace) %{_sysconfdir}/prime/current_type %{_sbindir}/prime-select %{_sbindir}/rcprime-select ++++++ SUSEPrime-0.7.1.tar.gz -> SUSEPrime-0.7.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SUSEPrime-0.7.1/prime-select.sh new/SUSEPrime-0.7.2/prime-select.sh --- old/SUSEPrime-0.7.1/prime-select.sh 2019-10-03 13:48:59.000000000 +0200 +++ new/SUSEPrime-0.7.2/prime-select.sh 2019-10-08 12:18:31.000000000 +0200 @@ -13,6 +13,7 @@ xorg_nvidia_conf="/etc/prime/xorg-nvidia.conf" xorg_intel_conf_intel="/etc/prime/xorg-intel.conf" xorg_intel_conf_intel2="/etc/prime/xorg-intel-intel.conf" +xorg_nvidia_prime_render_offload="/etc/prime/xorg-nvidia-prime-render-offload.conf" prime_logfile="/var/log/prime-select.log" nvidia_modules="nvidia_drm nvidia_modeset nvidia_uvm nvidia" driver_choices="nvidia|intel|intel2" @@ -25,11 +26,16 @@ panel_intel=eDP-1 panel_intel2=eDP1 +# Check if prime-select service is enabled. Some users may want to use nvidia prime offloading sometimes so they can disable service temporarily. +# SusePRIME bbswitch will work as non-bbswitch one +[ -f /etc/systemd/system/multi-user.target.wants/prime-select.service ] +service_test=$? + # Check if prime-select systemd service is present (in that case service_test value is 0) # If it is present (suse-prime-bbswitch package), the script assumes that bbswitch is to be used # otherwise (suse-prime package) it works without bbswitch -[ -f /usr/lib/systemd/system/prime-select.service ] -service_test=$? +[ -f /usr/lib/systemd/system/prime-select.service ] +service_test_installed=$? function usage { echo @@ -48,19 +54,19 @@ echo echo "nvidia: use the NVIDIA proprietary driver" echo "intel: use the Intel card with the \"modesetting\" driver" - echo " PRIME Render Offload possible with >= 435.xx NVIDIA driver" + echo " PRIME Render Offload possible with >= 435.xx NVIDIA driver with prime-select service DISABLED" echo "intel2: use the Intel card with the \"intel\" Open Source driver (xf86-video-intel)" - echo " PRIME Render Offload possible with >= 435.xx NVIDIA driver" + echo " PRIME Render Offload possible with >= 435.xx NVIDIA driver with prime-select service DISABLED" echo "unset: disable effects of this script and let Xorg decide what driver to use" echo "get-current: display driver currently configured" echo "log-view: view logfile" echo "log-clean: clean logfile" - if (( service_test == 0 )); then + if (( service_test_installed == 0 )); then echo "boot: select default card at boot or set last used" echo "next-boot: select card ONLY for next boot, it not touches your boot preference. abort: restores next boot to default" echo "get-boot: display default card at boot" - echo "service: disable, check or restore prime-select service. Could be useful disabling service" + echo "service: disable, check or restore prime-select service. Could be useful disabling service" echo " before isolating multi-user.target to prevent service execution." fi @@ -91,7 +97,16 @@ function check_service { if (( service_test != 0)); then - exit 1; + if (( service_test_installed != 0)); then + echo "SUSE Prime service not installed. bbswitch can't switch off nvidia card" + echo "Commands: boot | next-boot | get-boot | service aren't available" + exit 1; + else + echo "SUSE Prime service is DISABLED. bbswitch can't switch off nvidia card" + echo "Commands: boot | next-boot | get-boot aren't available" + echo "You can re-enable it using "prime-select service restore"" + exit 1; + fi fi } @@ -220,39 +235,44 @@ logging "Failed to build Intel card bus id" exit 1 fi - - gpu_info=$(nvidia-xconfig --query-gpu-info) - # This may easily fail, if no NVIDIA kernel module is available or alike - if [ $? -ne 0 ]; then - logging "PCI BusID of NVIDIA card could not be detected!" - exit 1 - fi - - # There could be more than on NVIDIA card/GPU; use the first one in that case - nvidia_busid=$(echo "$gpu_info" | grep -i "PCI BusID" | head -n 1 | sed 's/PCI BusID ://' | sed 's/ //g') - - libglx_xorg=$(update-alternatives --list libglx.so | grep xorg-libglx.so) - - update-alternatives --set libglx.so $libglx_xorg > /dev/null clean_xorg_conf_d - - cat $conf | sed -e 's/PCI:X:X:X/'${intel_busid}'/' -e 's/PCI:Y:Y:Y/'${nvidia_busid}'/' > /etc/X11/xorg.conf.d/90-intel.conf - + + cat $conf | sed -e 's/PCI:X:X:X/'${intel_busid}'/' > /etc/X11/xorg.conf.d/90-intel.conf + if (( service_test == 0)); then - modprobe -r $nvidia_modules + modprobe -r $nvidia_modules - if [ -f /proc/acpi/bbswitch ]; then + if [ -f /proc/acpi/bbswitch ]; then tee /proc/acpi/bbswitch > /dev/null <<EOF OFF EOF + logging "NVIDIA card will be switched off, NVIDIA offloading will not be available" fi logging "trying switch OFF nvidia: $(bbcheck)" + else + # extra snippet nvidia for NVIDIA's Prime Render Offload mode + gpu_info=$(nvidia-xconfig --query-gpu-info 2> /dev/null) + + # This may easily fail, if no NVIDIA kernel module is available or alike + if [ $? -eq 0 -a "$gpu_info" != "" ]; then + # There could be more than on NVIDIA card/GPU; use the first one in that case + nvidia_busid=$(echo "$gpu_info" | grep -i "PCI BusID" | head -n 1 | sed 's/PCI BusID ://' | sed 's/ //g') + logging "Adding support for NVIDIA Prime Render Offload" + cat $xorg_nvidia_prime_render_offload | sed -e 's/PCI:Y:Y:Y/'${nvidia_busid}'/' >> /etc/X11/xorg.conf.d/90-intel.conf + else + logging "PCI BusID of NVIDIA card could not be detected!" + logging "NVIDIA Prime Render Offload not supported!" + fi fi + libglx_xorg=$(update-alternatives --list libglx.so | grep xorg-libglx.so) + + update-alternatives --set libglx.so $libglx_xorg > /dev/null + logging "Intel card correctly set" } @@ -366,78 +386,73 @@ fi if (( service_test == 0)); then - - if ! [ -f /etc/systemd/system/multi-user.target.wants/prime-select.service ]; then - echo "ERROR: prime-select service seems broken or disabled by user. Try prime-select service restore" - exit 1 - fi if ! { [ "$(bbcheck)" = "[bbswitch] NVIDIA card is ON" ] || [ "$(bbcheck)" = "[bbswitch] NVIDIA card is OFF" ]; }; then bbcheck fi - #DM_check + #DM_check - # use this to determine current target as this is more reliable than legacy runlevel command that can return 'undefined' or 'N' - # see https://serverfault.com/questions/835515/systemd-how-to-get-the-running-target - # cannot use 'systemctl get-default' as default target may be different than current target - target=$(systemctl list-units --type target | egrep "^multi-user|^graphical" | head -1 | cut -f 1 -d ' ') + # use this to determine current target as this is more reliable than legacy runlevel command that can return 'undefined' or 'N' + # see https://serverfault.com/questions/835515/systemd-how-to-get-the-running-target + # cannot use 'systemctl get-default' as default target may be different than current target + target=$(systemctl list-units --type target | egrep "^multi-user|^graphical" | head -1 | cut -f 1 -d ' ') - # might be empty if script not invoked by sudo, ie directly by root - user=$SUDO_USER + # might be empty if script not invoked by sudo, ie directly by root + user=$SUDO_USER - if [ "$target" = "graphical.target" ]; then - #GDM_mode - if [ "$(systemctl status display-manager | grep gdm)" > /dev/null ]; then - $0 user_logout_waiter $type gdm $user & - logging "user_logout_waiter: started" + if [ "$target" = "graphical.target" ]; then + #GDM_mode + if [ "$(systemctl status display-manager | grep gdm)" > /dev/null ]; then + $0 user_logout_waiter $type gdm $user & + logging "user_logout_waiter: started" #SDDM_mode - elif [ "$(systemctl status display-manager | grep sddm)" > /dev/null ]; then - $0 user_logout_waiter $type sddm $user & - logging "user_logout_waiter: started" + elif [ "$(systemctl status display-manager | grep sddm)" > /dev/null ]; then + $0 user_logout_waiter $type sddm $user & + logging "user_logout_waiter: started" #lightdm_mode - elif [ "$(systemctl status display-manager | grep lightdm)" > /dev/null ]; then - $0 user_logout_waiter $type lightdm $user & - logging "user_logout_waiter: started" + elif [ "$(systemctl status display-manager | grep lightdm)" > /dev/null ]; then + $0 user_logout_waiter $type lightdm $user & + logging "user_logout_waiter: started" #XDM_mode - elif [ "$(systemctl status display-manager | grep xdm)" > /dev/null ]; then - $0 user_logout_waiter $type xdm $user & - logging "user_logout_waiter: started" + elif [ "$(systemctl status display-manager | grep xdm)" > /dev/null ]; then + $0 user_logout_waiter $type xdm $user & + logging "user_logout_waiter: started" #KDM_mode(uses xdm->calls xdm_mode) - elif [ "$(systemctl status display-manager | grep kdm)" > /dev/null ]; then - $0 user_logout_waiter $type xdm $user & - logging "user_logout_waiter: started" + elif [ "$(systemctl status display-manager | grep kdm)" > /dev/null ]; then + $0 user_logout_waiter $type xdm $user & + logging "user_logout_waiter: started" #unsupported_dm_force_close_option - else - echo "Unsupported display-manager, please report this to project page to add support." - echo "Script works even in init 3" - echo "You can force-close session and switch graphics [could be dangerous]," - read -p "ALL UNSAVED DATA IN SESSION WILL BE LOST, CONTINUE? [Y/N]: " choice - case "$choice" in - y|Y ) - killall xinit - $0 user_logout_waiter $type now $user - ;; - * ) echo "Aborted. Exit."; exit ;; - esac - fi - #manually_started_X_case - elif [ "$target" = "multi-user.target" ] && [ "$(pgrep -x xinit)" > /dev/null ]; then - $0 user_logout_waiter $type x_only $user & - logging "user_logout_waiter: started" - # from console without Xorg running - else - echo $type > /etc/prime/current_type - apply_current - exit - fi + else + echo "Unsupported display-manager, please report this to project page to add support." + echo "Script works even in init 3" + echo "You can force-close session and switch graphics [could be dangerous]," + read -p "ALL UNSAVED DATA IN SESSION WILL BE LOST, CONTINUE? [Y/N]: " choice + case "$choice" in + y|Y ) + killall xinit + $0 user_logout_waiter $type now $user + ;; + * ) echo "Aborted. Exit."; exit ;; + esac + fi + #manually_started_X_case + elif [ "$target" = "multi-user.target" ] && [ "$(pgrep -x xinit)" > /dev/null ]; then + $0 user_logout_waiter $type x_only $user & + logging "user_logout_waiter: started" + # from console without Xorg running + else + echo $type > /etc/prime/current_type + apply_current + exit + fi - else # no service used + else # no service used - echo $type > /etc/prime/current_type - apply_current + echo $type > /etc/prime/current_type + apply_current - fi + fi echo -e "Logout to switch graphics" ;; @@ -542,7 +557,11 @@ service) - check_service + if (( service_test_installed != 0)); then + echo "SUSE Prime service not installed. bbswitch can't switch off nvidia card" + echo "Commands: boot | next-boot | get-boot | service aren't available" + exit 1; + fi case $2 in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SUSEPrime-0.7.1/xorg-intel-intel.conf new/SUSEPrime-0.7.2/xorg-intel-intel.conf --- old/SUSEPrime-0.7.1/xorg-intel-intel.conf 2019-10-03 13:48:59.000000000 +0200 +++ new/SUSEPrime-0.7.2/xorg-intel-intel.conf 2019-10-08 12:18:31.000000000 +0200 @@ -24,13 +24,6 @@ BusID "PCI:X:X:X" EndSection -# needed for NVIDIA PRIME Render Offload -Section "Device" - Identifier "nvidia" - Driver "nvidia" - BusID "PCI:Y:Y:Y" -EndSection - Section "Screen" Identifier "intel" Device "intel" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SUSEPrime-0.7.1/xorg-intel.conf new/SUSEPrime-0.7.2/xorg-intel.conf --- old/SUSEPrime-0.7.1/xorg-intel.conf 2019-10-03 13:48:59.000000000 +0200 +++ new/SUSEPrime-0.7.2/xorg-intel.conf 2019-10-08 12:18:31.000000000 +0200 @@ -10,13 +10,6 @@ BusID "PCI:X:X:X" EndSection -# needed for NVIDIA PRIME Render Offload -Section "Device" - Identifier "nvidia" - Driver "nvidia" - BusID "PCI:Y:Y:Y" -EndSection - Section "Screen" Identifier "intel" Device "intel" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SUSEPrime-0.7.1/xorg-nvidia-prime-render-offload.conf new/SUSEPrime-0.7.2/xorg-nvidia-prime-render-offload.conf --- old/SUSEPrime-0.7.1/xorg-nvidia-prime-render-offload.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/SUSEPrime-0.7.2/xorg-nvidia-prime-render-offload.conf 2019-10-08 12:18:31.000000000 +0200 @@ -0,0 +1,8 @@ + +# needed for NVIDIA PRIME Render Offload +Section "Device" + Identifier "nvidia" + Driver "nvidia" + BusID "PCI:Y:Y:Y" +EndSection +
