Arch Linux kernel and NVidia recent bugs

I was facing frequent freeze of the laptop recently. The discussion can be found here.

Basically, there are two issues, one is the Linux kernel, and the other is the NVidia driver update.

Linux kernel causes some Oops in the kernel, probably related, I don’t know. The result is that I can’t shutdown my laptop because it cannot unmount /home and /tmp. To resolve this, I upgraded the Linux kernel to 6.7.8, and added zswap.enabled=0 and numa=off as the kernel parameter, in GRUB. I am not sure which one is the actual action that solve the issue.

Another issue that drives me crazy is the NVidia. Since NVidia 545, the laptop will freeze suddenly. After several trials, I change to nvidia-open-dkms. Besides that, I also experienced switching the TTY causing the black screen but the mouse is visible and movable. This is slightly different from the discussion on the forum, in which the other users reported having a black screen with a visible mouse after resuming from suspend to memory (sleep). After much trial and error, I found that the compositor picom caused the issue. If I kill picom, then there is no issue when switching TTY, or even resuming from suspend to memory.

The forum suggested to use NVreg_PreserveVideoMemoryAllocations=1 for the black screen issue. I tried, but it doesn’t work. Probably I did it wrongly.

Arch Linux Xorg failed to run

Today I updated the packages, then rebooted, then the machine got stuck at

[Started] Accounts Service

Seriously, I have had no issues with my laptop recently. And this makes me nervous. It will be troublesome if I have to boot into the Arch Linux LiveUSB. But luckily, searched online, and someone mentioned to change to another TTY with Ctrl+Alt+F2.

Wheew. I still can log in with the command-line. And then I noticed that, the issue must be NVidia driver related.

Since I faced the backlight bug of NVidia 545 driver, I have ignored the NVidia related packages during upgrading. Besides that, I am using DKMS as well. During the upgrading, I didn’t notice the following error

Error! Bad return status for module build on kernel: 6.7.3-arch1-1 (x86_64)

As a result, this causes lightdm failed to run.

With the alternative TTY, I install all the latest NVidia packages (545.29.06) and re-install the Linux kernel, DKMS builds without error.

Reboot, problem solved!

P/S: However, I found that I cannot resume from suspend to RAM properly, though sometimes there is no issue. I can see a black screen with a mouse moving, but not able to change to another TTY. This is super annoying. A similar issue is discussed here.

NVidia and hibernation issue, partially solved

In my previous post, I mentioned about NVidia and xcompmgr, it is not true reason that causes the Chrome not updating the display.

The root cause is partially found. The issue is caused by the optimus laptop (dual graphic card, NVidia with Intel). In unknown conditions, resume from hibernation will cause the Intel graphic card doesn’t work properly. This can be checked by running “glxgears” after resume. You will see the OpenGL fails to refresh on the display.

However, if installed bumblebee, then we can run “optirun glxgears”, and this solves the graphic card issue.

Children process

Now, there is a tricky issue. because I use GNOME-Do, it is not started with “optirun”, as a result, launching the application through GNOME-Do doesn’t use the NVidia graphic card. As a result, I need to quit GNOME-Do and start it with “optirun”. So, all the application launched by GNOME-Do will use the grphic card correctly.

Run with NVidia only

Unfortunately, I experienced failing to start the X window with NVidia graphic card only. And I didn’t disable Intel graphic card, because it becomes a waste for an optimus laptop. As a result, I cannot confirm whether if only using NVidia graphic card, will the display refresh issue exist.

But so far, I use the “optirun” to run the application, if the graphic card fails to refresh the display.

NVidia and probably xcompmgr

I have a Dell Vostro 5459 with Arch Linux. Previously, whenever I do a hibernation, and resume will produce a black screen, which I can do nothing.

Then I believed that one of the NVidia updates fixed this issue.

However, very soon later, I faced another issue is, resuming from hibernation causes Chromium with freeze content, or the content doesn’t redraw. This not only happen to Chromium, but also Opera and SMPlayer. I thought it is caused by NVidia. Tried a lot of solution, search nothing from Internet. I also installed “bbswitch”, nothing solved.

But just now, before I did a hibernation, I tried to exit every application related to the display or possibly doing some graphic things. Then I remembered that I always run “xcompmgr”, as it enables the composite feature on OpenBox. I killed it, and do a hibernation. And now resume from hibernation, and Chromium works fine.

So, possibly it is “xcompmgr” that causes the trouble all the time since NVidia fixed. To be confirmed.

Dell Vostro 5459 hibernation

In the previous post (1 year ago), I mentioned the hibernation issue. I believed that it was related to the NVidia graphic card. Related forum can be found here.

But these few days, I notice that whenever I shut down the laptop, it will show the systemd messages. Previously, if I did suspend my laptop, then resume, then shut down will show only black blank screen, until the power off. I believe that the graphic card issue is being fixed with the recent update.

I am now using linux-lts 4.9.13-1 and nvidia-dkms 378.13-2

Dell Vostro 5459 review and setup

Due to the changes of the career, I invested on Dell Vostro 5459, after a long survey. I chose it because it is compatible to Linux. The compatibility to Linux meaning that, all the hardware devices are accessible by Linux. Besides that, it has the NVIDIA graphic card, which allows me to use GPGPU to do my research and study. Moreover, I can play high quality 3D graphics games.

Ubuntu

So, the laptop I bought was pre-installed with Ubuntu. And, I was impressed by the Ubuntu first boot video, which can be found here.

Partition and bootloader

It is new laptop, thus the hard disk partitioning table is using GPT format instead of MBR format. And the laptop uses UEFI boot system by default. It will be very convenient to have multiboot with several OSes.

In order to do partitioning, I used my favourite tool, SystemRescueCD. But I failed to run the X11 window, due to the very new NVIDIA graphic card. (I believe I can run the X11 now.)

Before partitioning and formatting the hard disk, I checked the xorg.conf from the existing Ubuntu, believed that it can help me to figure out how to start X11 window in SystemRescueCD. Then I discovered that /etc/X11/xorg.conf does not exist. This is a very important point.

Consequently, I used the command-line interface to re-partitioning the hard disk. Because I was going to install Windows and Arch Linux on it.

Windows

Though I prefer Linux, Ubuntu not my primary OS. So, I have to install the Arch Linux. Before installing Arch Linux, due to the luxurious hardware specification, I intended to install Windows 7. The laptop does not have USB2.0, but only USB3.0, and I didn’t want to install Windows 7 through external DVD-ROM, because I didn’t want to burn Windows 7 to a DVD. As a result, Windows 7 with USB3.0 cannot be installed. Looking for the solution, extra drivers are required. Thus, I gave up Windows 7 and tried Windows 8.1. (Sorry, Windows 8 and 10 are not my favourite.)

Great. Windows 8.1 is not bad after installation. I came back to Windows drivers later, since Windows is my secondary OS, for the purpose of… gaming.

Arch Linux

Installing Arch Linux needs some skills, and Internet connection is very important. So, I installed all the packages based on the old laptop, just following the powerful Arch Linux Wiki.

NVIDIA

NVIDIA GeForce 930M is very troublesome. After installing Arch Linux, to fully utilise my graphic card, I decided to use NVIDIA driver instead of Nouveau.

However, nvidia-xconfig generated xorg.conf file does not work. I failed to run the X11 window as in the SystemRescueCD.

As a result, I removed the NVIDIA related section in the xorg.conf according to the Arch Linux forum here. And the pre-installed Ubuntu does not have the xorg.conf as well. After removing the file, X11 window works fine.

After running the Arch Linux and configuring my preferences, I found that some of the screensavers (from xscreensaver) showed the error message,

Xlib: extension "GLX" missing on display ":0"

So, I knew that there is something wrong with my Xorg configuration and the NVIDIA.

Keep doing the trial and error, then I discovered something called bumblebee. Actually I am still very confused with this bumblebee, only know that it is related to NVIDA Optimus. And, I also don’t know what the hell is NVIDIA Optimus, only know that it is something wonderful.

After installing bumblebee, then the nvidia-libgl package is replaced by mesa-libgl. And the xscreensaver did not show the error message above anymore.

Since installed bumblebee, I supposed I can use Optimus with optirun command. Running

optirun glxgears -info

I got the new error,

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
...

Then, I thought may be my NVIDIA is too new, so I tried to install nvidia-beta. But it did not solve the problem as well.

As a result, I tried nvidia-dkms. Yeah! It works. “optirun” works fine now.

Windows 8.1

I love Dell, because the drivers are available online. I just download all the important drivers, graphic card, sound card, WiFi drivers, etc. Then I booted into Windows 8.1, and installed all the drivers. I just wonder, Arch Linux can use the WiFi device immediately during the installation, but Windows cannot? That means, if I have Windows and WiFi only, but does not have the driver, then how can I download the drivers?

After installed all the drivers, then I booted into Arch Linux, but failed. Because I failed to mount the Windows partition in Linux after installing the drivers. Then I found that, it is because of the Fast Startup feature in Windows 8. (Solution is here, look for the Fast Startup.) Because Fast Startup causes the partition “not clean”, so that Linux cannot mount it.

After disabling the Fast Startup, then everything works fine now.

Data transfer

Transferring vast amount of data between computers is very time consuming. I previously used an external hard disk. But transferring data from a 500G laptop to a 1T laptop, using an external hard disk is not applicable, since I don’t have extra empty hard disk.

At the end, I used the ethernet cable to transfer the data. (This is what I learnt from my student previously.) In Linux, I used the Network Manager to share the wired connection. Then directly connect two laptops with a single ethernet cable, and router is not required. Ethernet cable is faster than WiFi, and I can transfer whatever data I want from A to B or vice versa.

But still, I have to use the SSH to mount the target laptop.

This is a time consuming process.

Hibernation and resume issue

Now the only problem is resume from hibernation in Arch Linux. The resuming from hibernation works inconsistently. I have tried to install Linux LTS version, but it is worse because I cannot use Fn key after booting in Linux LTS.

I am still figuring out how to solve this problem.

Xfce4 Power Manager, NVIDIA, Nouveau backlight issue

Recently I move back to use my (around) 4 years old laptop, HP Pavilion dv3. It has NVIDIA graphic card. But since I (re-)installed Arch Linux 64 bit on it, I failed to run the X11 with the proprietary NVIDIA driver. As a result, I used the Nouveau module instead. Then, I tried several times and finally successfully run the X11 with NVIDIA driver.

To use the Nouveau module, in the mkinitcpio.conf, we have to add in “nouveau” module, then build the initramfs (refer to wiki page). And use the “Xorg -configure” to generate the xorg.conf.

But in order to use the NVIDIA driver, firstly, has to identify the NVIDIA graphic card and download the related drivers. Secondly, since I am using 64 bit, but also running 32 bit packages, so I have to install all the corresponding lib32 NVIDIA packages. Moreover, the nvidia*-libgl are conflicted to mesa-libgl, which is used by Nouveau. After installing NVIDIA, use “nvidia-xconfig” to generate the xorg.conf.

We can also disable the splash screen (logo) when starting the X11, by adding

Options "NoLogo" "1"

in the “Device” section in the xorg.conf.

Then after using the NVIDIA, I face a serious problem, that is the xrandr (in fact I am usign ARandR) cannot change the screen resolution. This is troublesome as I need to make the changes towards the projector (2nd screen) frequently, such as two screens (left screen and right screen), laptop only (disable the projector), or clone (both laptop and the projector share the same screen). With the NVIDIA, xrandr cannot detect other resolutions, consequently I cannot make clone of the screen. So, I decided to use back Nouveau.

However, I have another serious problem with Nouveau module, that is, adjusting the backlight brightness (screen brightness). When I use xbacklight, it shows

No outputs have backlight property

I cannot adjust the backlight brightness using the usual keyboard key with Xfce4 Power Manager. Some forums stated that adding “acpi_backlight=xxxx” to the kernel parameter. But none of them works.

In my /sys/class/backlight, there are acpi_video0 and nv_backlight. Actually, I can change the backlight by echo the value to the acpi_video0/brightness, with “su”. Yet the nv_backlight does not show any effect.

I found that, I can use the keyboard key to adjust the brightness before start the Xfce4. Once the Xfce4 started (with Power Manager), the brightness change takes no effect. And the changes of the brightness is affecting the nv_backlight/brightness. So, I concluded that it is actually fixable by fixing the Xfce4 Power Manager.

As a result, I patched the Xfce4 Power Manager by editing the source code, to remove the “nv_backlight” from the priority. Install this patched package, restart the Xfce4, and now, it works!