Leap 15.6 – upgrade from Leap 15.5 on laptop with Optimus architecture

The last 4 months I was primarily occupied with physics. I got a bit sloppy regarding upgrades of my Linux systems. An upgrade of an rather old laptop to Leap 15.6 was overdue. This laptop had an Optimus configuration: To display graphics one can use either the dedicated Nvidia card or a CPU-integrated Intel graphics or both via an “offload” option for certain applications.

General steps to perform the upgrade

I just list up some elementary steps for the upgrade of an Opensuse Leap system – without going into details or potential error handling:

Step 1: Make a backup of the present installation
You can, for example, create images of the partitions or LVM volumes that contain your Leap-installation and transfer them to an external disk. Details depend of course on whether and how you have distributed system files over partitions or (LVM) volumes. In the simple case of just one partition, you may simply boot a rescue system, mount an external disk to /mnt and then use the “dd”-command;

# dd status=progress if=/dev/YOUR_PARTITION of=/mnt/bup_leap155.img  bs=4M 

Step 2: Update the installed packages of the present Leap installation
Perform an update of (all) installed packages – if newer versions are available. Check that your system runs flawlessly afterwards.

Step 3: Change the addresses of repositories to use the ${releasever} variable
You can e.g. use YaST to change the release number in the definition of your repositories’ addresses to the variable ${releasever}. The name of the SLES repository may then look like “https://download.opensuse.org/update/leap/${releasever}/sle/”.

Step 4: Refresh the repositories to use information for Leap 15.6 packages
The following CLI-command (executed by root, e.g. in a root-terminal window) will refresh basic repository data to reflect available packages for Leap 15.6:

mytux:~ # zypper --releasever=15.6 refresh 

In case of problems you may have to deactivate some repositories.

Step 5: Download 15.6 packages without installing them
You can download the new packages ahead of installing them. This is done by the following command:

mytux:~ # zypper --releasever=15.5 dup --download-only --allow-vendor-change

Do not forget the option “–allow-vendor-change” for obvious reasons.

Step 6: Installation of 15.6 packages on a TTY
Change to a TTY outside your graphical environment (e.g. to TTY1 by pressing Ctrl-Alt-F1). On the command line there first shut down your graphical environment and then perform the upgrade:

mytux:~ # init 3
mytux:~ # zypper --no-refresh --releasever=15.5 dup --allow-vendor-change  

Step 7: Reboot

In my case this sequence worked without major problems. I just had to accept the elimination of some files of minor importance for which there was no direct replacement. The whole upgrade included a direct upgrade of Nvidia drivers from the Nvidia community repository

https://download.nvidia.com/opensuse/leap/${releasever}/   

First impression after reboot

The transition from Leap 15.5 to Leap 15.6 on my laptop was a smooth one. KDE Plasma is still of main version 5. The important applications for daily use like e.g. Libreoffice, Kmail, Kate, Gimp, Opera, Firefox, Chromium simply worked. Sound based applications worked as before and as expected (still based in my case on some Pulseaudio components – as the Ladspa-equalizer). Codecs and video components (basically from the Packman repository) did their service.

However, to get the Optimus architecture to work as before I had to perform a few additional steps. See below. Afterward, I could use Suse’s “prime-select” scripts to control which of the available graphics card is active after boot. A switch between the cards just requires a log out of a graphics session followed by a new login.

I have not yet tested Wayland thoroughly on the laptop. But a first impression was a relatively good one. At least for the Intel graphics card active (i915 driver) and the Nvidia card deactivated completely. A problem is still that some opened applications and desktop configurations are still not remembered on KDE Plasma between different consecutive sessions with Wayland. There may be users who can not live with this.

A transition to the StandBy mode worked perfectly with the graphics card integrated in the CPU, with and without Wayland. It also appears to work with the Nvidia card (with and without Wayland).

Reconfigure your repositories without using the Opensuse CDN service

I do not like the automatic clattering of the repositories by the CDN service. I neither like the reference to “http”-addresses instead of “https”. I want to configure my repositories and the addresses manually.

To achieve this one has to delete the CDN service as described here: https://forums.opensuse.org/t/how-to-disable-cnd-repo-in-leap15-6/181830
Before you do that keep a copy of the list of your repositories somewhere. After the deletion of the service you may have to add very important repositories manually. Elementary and important repositories are

  https://download.opensuse.org/distribution/leap/${releasever}/repo/oss/
  https://download.opensuse.org/update/leap/${releasever}/oss
  https://download.opensuse.org/update/leap/${releasever}/sle/
  https://download.opensuse.org/update/leap/${releasever}/backports/
  https://ftp.fau.de/packman/suse/openSUSE_Leap_${releasever}/
  https://download.opensuse.org/distribution/leap/${releasever}/repo/non-oss/
  https://download.opensuse.org/update/leap/${releasever}/non-oss
  https://download.opensuse.org/repositories/security/${releasever}/
  https://download.nvidia.com/opensuse/leap/${releasever}/

Check and potentially reconfigure your Python and PHP environments

Just some remarks. Leap 15.6 offers Python3.11 aside 3.6. You may want change your virtual Python environments to the 3.11 interpreter – if you have not done this before – and control your Python modules for 3.11 with “pip”. Details are beyond the limits of this post. But let me assure you – it works. PHP is now available at version 8.2 – and can e.g. be used in the Apache-server. Eclipse based PHP and PyDEV IDEs work with the named versions of PHP and Pyhon3.

Controlling the Optimus environment

In my previous Leap 15.5 installation I had used the “prime-select” command to switch between an active Intel or the dedicated Nvidia card for a graphical desktop session (in my case with KDE). This was easy and convenient. In a root terminal you just execute either

mytux:~ # prime-select intel

or

mytux:~ # prime-select nvidia

and afterward logout and login again to your graphical desktop environment, which gets started on the right graphics card

The status before the upgrade to Lap 15.6 was one that the laptop booted with the Intel graphics card active, i915 driver loaded and the Nvidia card having been switched off (via an execution of bbswitch).

After the upgrade the laptop booted into a state with the Intel card being active, i915 driver loaded and used to display graphics on the screen, but the Nvidia card also being powered on, but with no Nvidia driver loaded. This means that the Nvidia card consumes power unnecessarily.

The unusual point was that with Leap 15.5 the Nvidia card got automatically deactivated, after I had used the command “prime-select intel” and restarted a graphical session or rebooted afterward. So, what was defunct?

The first thing to note is that the packages of suse-prime are of version 0.8.14. You find respective information how to deal with these packages at Github:
https://github.com/ openSUSE/ SUSEPrime
and within the Release Notes of Leap 15.6:
https://doc.opensuse.org/ release-notes/ x86_64/ openSUSE/ Leap/15.6/
Search for “prime” there.

We find the following information in the Release Notes:

Deprecated Packages
Removed packages are not shipped as part of the distribution anymore.
The following packages were all superseded by NVIDIA SUSE Prime. Also see Section 4.1, “Removal of Bumblebee packages. bbswitch / bumblebee / bumblebee-status / primus

Removal of Bumblebee packages
Packages maintained as part of X11:Bumblebee project were succeeded by NVIDIA SUSE Prime. Bumblebee packages will no longer be part of the standard distribution. See details in the drop feature request tracker.

This means – among other things – that the RPM for “bbswitch” no longer is included in the main repository for Leap 15.6. This is, in my opinion, a mistake. Which you will understand in a minute.

How to witch off the Nvidia card when using Intel graphics only?

One reason is that the information in the Release Notes and at Github is a bit misleading:

The statement on a “super-seeded SUSE PRIME” in the Release Notes and the section on “NVIDIA power off support since 435.xxx driver …” gives you the impression that one can deactivate (= power off) the Nvidia GPU by some other means than “bbswitch”. This is not the case. See the issue “Use manual remove for PCI device instead of Bbswitch?” at Github and also the source codes there.

Furthermore the commands in the section “NVIDIA power off support since 435.xxx driver …” do not specify where the files, which have to be copied into certain directories reside after a Leap15.6 upgrade. Instead of the first and the third command you may actually have to use

test -s /etc/modprobe.d/09-nvidia-modprobe-pm-G05.conf || \
   cp /lib/modeprobe.d/09-nvidia-modprobe-pm-G05.conf /etc/modprobe.d

test -s /etc/udev/rules.d/90-nvidia-udev-pm-G05.rules || \
   cp /usr/lib/udev/rules.d/90-nvidia-udev-pm-G05.rules /etc/udev/rules.d/

The file “90-nvidia-dracut-G05.conf” should already be in /etc/dracut.conf.d.

Afterwards check the directories /etc/modprobe.d/, /etc/dracut.conf.d/ and also /etc/dracut.conf.d/ for the necessary files.

The most important step is, however, that you must install “bbswitch” if you want to deactivate the Nvidia card completely. I.e., whenever you want to use the Intel graphics only.

You need the “Bumblebee” repository to get the respective RPM. The repo’s address is:

https://download.opensuse.org/repositories/X11:/Bumblebee/15.6/   

Just install “bbswitch”. Afterward, you can use the following commands to switch the Nvidia card off, when you use the Intel graphics and when only the i915 driver module is loaded.

mytux:~ # tee /proc/acpi/bbswitch <<< OFF

But according to the commands in the shell scripts this should happen automatically when you switch between graphics cards via the command “prime-select” and a logout/login sequence from/to the graphical desktop. In my case this worked perfectly. At least with X11.

I should also say the following:

With an active Nvidia card for graphics you can use dynamic power management. You can configure it e.g. with the “nvidia-settings” application.

Offload

With an active Intel graphics for the desktop and switched on Nvidia card you can even run certain applications on the Nvidia card. To configure this you need to select the option

mytux:~ # prime-select offload

Furthermore you need to create a script “prime-run” with the following contents:

!/bin/bash
__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"

Details can be found here. You must make the script executable and put it in your PATH. Afterward, you can call applications with “prime-run”, e.g. “prime-run gimp”.

mytux:~> # prime-run gimp

Have fun with Leap 15.6!

 

Opensuse Leap 15.5 – YaST2 bug – no repositories can be added via YaST2

In one of the last posts I have said that upgrades of running Opensuse Leap 15.4-systems to Leap 15.5 are a smooth business. However, a major bug in the present Leap 15.5 did not appear on my radar until now.

During the upgrades of most of my systems I just continued using a system-specific bunch of active Opensuse repositories – like the “graphics” and the “security” repositories. I used the ${releasever}-mechanism during the upgrades to point zypper to the new versions of the repositories. This all went well and after the upgrade I found the 15.5-versions of those repositories, which I had used on Leap 15.4 before, integrated into the YaST2-software and package management of Leap 15.5.

But, two days ago, I installed Leap 15.5 on a laptop from an ISO-image on a DVD. Such an installation only sets up basic Leap 15.5 repositories. So, after the installation I wanted to add further repositories via YaST2’s software-management. This did not work at all. The repositories simply did not appear in the list of managed repositories afterwards.

I fiddled around for about an hour. It became clear by switching views on repos and so called “services” that the requested new repositories were handled by YaST as SW-services, instead as standard repositories. Whatever “services” are going to be good for in the future. I could find some information at
https://news.opensuse.org/ 2023/07/31/ try-out-cdn-with-opensuse-repos/.

I moved in the end to zypper on the command line to add repositories. Which worked …. A good reason to suspect a bug.

Bug: Adding repositories with YaST2 does not work presently

Indeed: The following two links showed that other Opensuse users had the same problem and that there is a related bug-entry at Opensuse’s bugzilla:
https://forums.opensuse.org/ t/ cant-add-repos/ 171641
https://bugzilla.opensuse.org/ show_bug.cgi?id=1218399

Well, YaST2 is a central tool-box for Opensuse systems. And who would deny that the package manager is one of the most important tools on any Linux system? So, old kinds of questions regarding quality assurance came to my mind: Are changes to central Leap components tested thoroughly at Opensuse? In particular as also SLES is affected …. Unbelievable …

The affected package is yas2-packager 4.5.17-150500.3.3.1.

Workaround

Adding repositories directly via zypper (which is used by YaST2) still works. So, you can add add repositories like the security repository, with command analogous to the following:

mytux:~ # zypper ar -f https://download.opensuse.org/repositories/security/15.5 security
Adding repository 'security' 
..................................................................................[done]
Repository 'security' successfully added

URI         : https://download.opensuse.org/repositories/security/15.5
Enabled     : Yes
GPG Check   : Yes
Autorefresh : Yes
Priority    : 99 (default priority)

Repository priorities are without effect. All enabled repositories share the same priority.

These repos afterward appear in the YaST2 packet manger and are fully usable to install RPM packages.

Weird aspect of the YaST2 packet manager: Opensuse and Nvidia services cannot be deleted via YaST2

After some updates of leap 15.5 you may find that all basic repositories have been switched to “services” at “cdn.opensuse.org”. What is disturbing: A fresh installation of Leap 15.5 from an ISO-image does not show any of the services displayed in the image above.

Once you got the “services” in your Leap 15.5 installation you may want to delete them and restrict your system to the standard repositories at “download.opensuse.org”. But this does not work with YaST2. Which appears as an additional bug. You may switch to “services” and delete them in the views coming up. And everything afterward gives you the impression that they are gone. But no: After a restart of YaST2 and the packet manager all Opensuse services appear restored again.

Conclusion

YaST2’s present packet manager for Leap 15.5 has a major bug: Repositories can not be added. In addition one cannot get rid of the new Opensuse services. Let us hope that we get a new and error free version of YaST2’s packet manager soon.

Opensuse Leap 42.1 – Amarok – Abstürze, Freezes – Wechsel zu Packman Paketen erforderlich

Eine Testapplikation für die Funktionstüchtigkeit neuer KDE-Versionen – wie nun KDE 5 – ist für mich u.a. Amarok. Ich nutze für die Musikberieselung beim Arbeiten in der Regel zwar lieber das übersichtlichere und in seinen Funktionen i.d.R. auch stabilere Clementine. Aber Amarok offenbart oftmals Schwächen im Zusammenspiel mit Phonon und den Phonen-Backends sowie mit Codecs.

Besonders interessant war ein Amarok-Test im vorliegenden Fall für ein frisch installiertes Opensuse Leap-System auch deshalb, weil Amarok nur in der Version 2.8 vorliegt, die meines Wissens eigentlich für KDE 4.14 entwickelt wurde. Unter Leap 42.1 kommt aber KDE 5 zum Einsatz.

Nach meinen ersten Erfahrungen mit Opensuse Leap 42.1 und KDE 5 gilt grundsätzlich: Eigentlich kann man die Pakete, die SuSE einem auf der Leap 42.1-Installations-DVD anbietet, vergessen. Damit bekommt man auf einem etwas komplexeren Desktop-System mit Nvidia-Karte und mehreren Soundkarten jedenfalls kein dauerhaft stabiles und flüssig funktionierendes System mit KDE-Plasma-Desktop hin.

So führte bei mir u.a der Aufruf von Amarok in den Abgrund. Es gab ganz verschiedene und erratisch auftretende Varianten von Fehlern, die ein Amarok-Start (und ggf. auch ein Aufruf des integrierten Equalizers) bei mir auf einer Leap-Standardinstallation provozierte – Absturz des Plasma-Desktops, Freeze des Desktops, Freeze von Amarok, kein Start von Musik-Dateien möglich (weder MP3 noch Ogg Vorbis, noch ….). Mit und ohne Pulseaudio ….

Dabei lief/läuft Clementine auf Anhieb anstandslos. Also war das Sound-System des KDE 5-Desktops wohl grundsätzlich lauffähig. Eine Lösung brachten schließlich folgende Schritte:

  1. Update aller installierten Pakete mit Hilfe der Standard Opensuse Online Repositories.
  2. Packman und VideoLan-Repositories in den YaST-Paketmanager einbinden.
  3. Diverse Codec-Pakete, Lame und was man sonst noch für seine Sound-Applikationen braucht aus dem Packman-Verzeichnis laden.
  4. Wechsel für alle Pakete, bei denen das möglich ist (u.a. zu Gstreamer), von den Versionen der Opensuse Standard- und Upgrade-Repositories zu den Versionen des Packman-Repositories.
    Nachtrag 25.01.2016:
    Es gibt eine bemerkenswerte Ausnahme: Das Paket “freshplayerplugin” sollte man in seinen neuesten Versionen weder aus dem Packman- noch aus dem Multimedia-Repository installieren, wenn man Eclipse Mars mit GTK2 betreiben will. Siehe hierzu einen kommenden, gesonderten Blog-Beitrag.
  5. Löschen sämtlicher “amarokrc”- und relatierter Dateien sowie auch der Datei “.gstreamer-0.10” im eigenen Home-Verzeichnis. Die werden automatisch neu angelegt.
  6. Zur Not einen anderen neuen User aufsetzen und mal für diesen neuen User testen. Bei Erfolg, den ursprünglichen User komplett neu aufsetzen.

Nun laufen sowohl Amarok als auch Clementine.

Dass ich auf Desktop-Systemen außerdem Pulseaudio abschalte (geht am einfachsten über YaST2 und die dortige Sound-Konfiguration) und lieber auf Plain Alsa vertraue, wissen die Leser meines Blogs eh’ schon. Das hat aber mit dem Amarok-Problem und der dahinter liegenden Inkonsistenz diverser Pakete des SuSE-Systems weniger zu tun ….