Linux5.19.3 --> Linux6.0-rc2-1 (Experimental) Doesn't launch Plasma DE anymore

With Linux6.0-rc2-1 kernel:

~> systemctl status display-manager.service
â—Ź sddm.service - Simple Desktop Display Manager
     Loaded: loaded (/usr/lib/systemd/system/sddm.service; enabled; preset: disabled)
     Active: active (running) since Wed 2022-08-24 00:33:51 EEST; 4min 10s ago
       Docs: man:sddm(1)
             man:sddm.conf(5)
   Main PID: 1248 (sddm)
      Tasks: 2 (limit: 154438)
     Memory: 24.4M
        CPU: 14ms
     CGroup: /system.slice/sddm.service
             └─1248 /usr/bin/sddm

aug. 24 00:33:51 dell-nvme-inspiron7577 systemd[1]: Started Simple Desktop Display Manager.
aug. 24 00:33:51 dell-nvme-inspiron7577 sddm[1248]: Initializing...
aug. 24 00:33:51 dell-nvme-inspiron7577 sddm[1248]: Starting...
aug. 24 00:33:51 dell-nvme-inspiron7577 sddm[1248]: Logind interface found

Seems normal.

There are no Nvidia modules for the 6 kernel yet, don’t understand why you already want to test it …

5 Likes
  1. Current lack of knowledge that I need to track nVidia module version with Linux kernel version.
  2. Wanting to test report on experimental issues early.
  3. Always trying to use the most recent non-rt kernel available through Manjaro Kernels GUI by default, unless something doesn’t work out.

I think we both can agree that, if nVidia modules for linux6 kernel are missing and there is nVidia card which is used for displays, then something somewhere should output this issue into log for the next time. Ideally as TTY text on failed DE boot. Maybe there already is this log ?

To be fair this is like that all the times, some modules are not built with the RC experimental kernels available.

You probably can install the DKMS Nvidia driver I guess?

1 Like

With the following patch, it is possible to have the nvidia 515 driver compiled against kernel 6.0:

--- a/kernel/nvidia-drm/nvidia-drm-helper.c	2022-08-26 11:42:33.152047728 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-helper.c	2022-08-26 11:42:51.741615701 +0200
@@ -28,7 +28,7 @@
  */
 
 #include "nvidia-drm-helper.h"
-
+#include <drm/drm_framebuffer.h>
 #include "nvmisc.h"
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)

With that patch applied, the DKMS modules for kernel 6.0 install without error, and also appear to be functioning.
I am currently writing this text running kernel 6.0.0-1-MANJARO with Nvidia driver 515.65.01.

Hello,

at first, thanks a lot to the folks who made the Linux kernel 6.0 available in Manjaro Testing.
If you want to test that kernel and have an Nvidia graphics card installed in your machine which uses the proprietary driver 515.65.01, you can do so with the help of Robert Gadson’s solution: http://rglinuxtech.com/?p=3053

In Manjaro, you need the files below, if you are using the DKMS approach to load drivers. Just create them in an empty directory.

  1. PKGBUILD
##############################
# Now working with Kernel 6.0
##############################
# based on the 340xx package #
# Maintainer: Jerry Xiao <aur@mail.jerryxiao.cc>
# Maintainer: graysky <graysky AT archlinux DOT us>
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

pkgbase=nvidia-515xx
pkgname=(nvidia-dkms)
pkgver=515.65.01
pkgrel=4
pkgdesc="NVIDIA drivers for linux, 515xx current branch"
arch=('x86_64')
url="https://www.nvidia.com/"
makedepends=("nvidia-utils" 'linux>=6.0' 'linux-headers>=6.0')
conflicts=('nvidia')
license=('custom')
options=(!strip)
_durl="http://us.download.nvidia.com/XFree86/Linux-x86"
source=("${_durl}_64/${pkgver}/NVIDIA-Linux-${CARCH}-${pkgver}-no-compat32.run"
        "kernel-6.0.patch")
sha256sums=('89e9c22b3903a2360bb18a7f1220dc52234b2cb928bb9dd6690236cf2b024695'
            '8fc3b8eea5e0a566cde2e58d6d4955b7506b50a1754cfb049d118750dca43188')

_pkg="NVIDIA-Linux-${CARCH}-${pkgver}-no-compat32"

prepare() {
    # Remove previous builds
    [ -d "$_pkg" ] && rm -rf "$_pkg"
    sh "${_pkg}.run" --extract-only
    cd "${_pkg}"
    # patches here
    # Fix compile problem with 6.0
    echo "PATCH: kernel-6.0.patch (improved)"
    patch -p1 -i "$srcdir"/kernel-6.0.patch

    cd kernel
    sed -i "s/__VERSION_STRING/${pkgver}/" dkms.conf
    sed -i 's/__JOBS/`nproc`/' dkms.conf
    sed -i 's/__DKMS_MODULES//' dkms.conf
    sed -i '$iBUILT_MODULE_NAME[0]="nvidia"\
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\
BUILT_MODULE_NAME[1]="nvidia-uvm"\
DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\
BUILT_MODULE_NAME[2]="nvidia-modeset"\
DEST_MODULE_LOCATION[2]="/kernel/drivers/video"\
BUILT_MODULE_NAME[3]="nvidia-drm"\
DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf

    # Gift for linux-rt guys
    sed -i 's/NV_EXCLUDE_BUILD_MODULES/IGNORE_PREEMPT_RT_PRESENCE=1 NV_EXCLUDE_BUILD_MODULES/' dkms.conf

    cd ..
    cp -a kernel kernel-dkms

}

package_nvidia-dkms() {
    pkgdesc="NVIDIA driver sources for linux, 515xx current branch"
    depends=('dkms' "nvidia-utils=$pkgver" 'libgl' 'linux>=6.0')
    optdepends=('linux-headers: Build the module for Manjaro kernel')
    provides=("nvidia-515xx=$pkgver")
    conflicts+=('nvidia-515xx')

    cd "${_pkg}"

    install -dm 755 "${pkgdir}"/usr/src
    cp -dr --no-preserve='ownership' kernel-dkms "${pkgdir}/usr/src/nvidia-${pkgver}"

    echo "blacklist nouveau" |
        install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
}

# vim:set ts=2 sw=2 et:
  1. kernel-6.0.patch
--- a/kernel/nvidia-drm/nvidia-drm-helper.c	2022-08-26 11:42:33.152047728 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-helper.c	2022-08-26 11:42:51.741615701 +0200
@@ -28,7 +28,7 @@
  */
 
 #include "nvidia-drm-helper.h"
-
+#include <drm/drm_framebuffer.h>
 #include "nvmisc.h"
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
  1. nvidia.install
EXTRAMODULES='extramodules-6.0-MANJARO'

post_install() {
    depmod "$(cat /usr/lib/modules/${EXTRAMODULES}/version)"
    echo 'In order to use the nvidia module, reboot the system.'
}

post_upgrade() {
    post_install
}

post_remove() {
    post_install
}

After that, run the usual makepkg -i command to install that package :wink:

is there any invention for nvidia that make sense using kernel 6.0 or just a game for early adaptors ?

Simply curiosity to check if it works :smiley:
And besides that, the kernels seem to become EOL faster and faster - so I just wanted to take the chance to test the 6.0 kernel before it also becomes EOL :joy:

And for why kernel 6.0? It was announced in some places that it will provide a huge performance increase: Linux 6.0 Supporting New Intel/AMD Hardware, Performance Improvements & Much More - Phoronix - so that made me even more eager to test it :slight_smile:

…then install linux60-nvidia. :wink:

2 Likes

The Nvidia developers are aware of that issue, too: Add missing include to fix 6.0-rc1 build by asuka-mio · Pull Request #350 · NVIDIA/open-gpu-kernel-modules · GitHub
They propose including <drm/drm_framebuffer.h> in nvidia-drm-helper.h instead of nvidia-drm-helper.c to improve its availability:

--- a/kernel/nvidia-drm/nvidia-drm-helper.h	2022-08-26 11:42:33.152047728 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-helper.h	2022-08-26 11:42:51.741615701 +0200
@@ -108,6 +108,7 @@ nv_drm_prime_pages_to_sg(struct drm_device *dev,
 * OTHER DEALINGS IN THE SOFTWARE.
 */
#include <drm/drm_crtc.h>
#include <drm/drm_framebuffer.h>

#if defined(drm_for_each_plane)
#define nv_drm_for_each_plane(plane, dev) \

not good with recent changes about conf include headers :
drm_framebuffer will be included in others components outside Nvidia …
this is not nvidia headers …

I am afraid that I do not understand your point.
Adding #include <drm/drm_framebuffer.h> to kernel/nvidia-drm/nvidia-drm-helper.h was proposed by the Nvidia developers themselves, and I am sure they understand what they are doing :slight_smile:

Update: As expected, the driver compiles and works flawlessly with #include <drm/drm_framebuffer.h> in kernel/nvidia-drm/nvidia-drm-helper.h as per the following patch:

--- a/kernel/nvidia-drm/nvidia-drm-helper.h	2022-08-26 11:42:33.152047728 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-helper.h	2022-08-26 11:42:51.741615701 +0200
@@ -108,6 +108,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 #include <drm/drm_crtc.h>
+#include <drm/drm_framebuffer.h>
 
 #if defined(drm_for_each_plane)
 #define nv_drm_for_each_plane(plane, dev) \

As for an explanation for those who are interested what is going on:
Per https://github.com/torvalds/linux/commit/720cf96d8fecde29b72e1101f8a567a0ce99594f , #include <drm/drm_framebuffer.h> was removed from <drm/drm_crtc.h> in kernels >= 6.0 because there was no need for that include in <drm/drm_crtc.h> from kernel developer perspective.
Hence, we now have to include it separately in case it is needed (as for our Nvidia driver). Obviously, the best place to add that separate #include <drm/drm_framebuffer.h> is alongside <drm/drm_crtc.h> in kernel/nvidia-drm/nvidia-drm-helper.h.

Is it discouraged to use DKMS with kernels >= 6.0? If yes, can you provide us with some more detail?
At least, DKMS seems to be still supported by kernel 6.0-rc2 and I am able to install and run the patched Nvidia DKMS module on my machine.

You can use nvidia-dkms if it works. It didn’t with rc1 when I tested it.

I was just letting you know linux60-nvidia was available as it wasn’t before.

Unfortunately, there seems to be no page for nvidia-dkms on Manjaro Gitlab so it was not possible to submit the patch (see Linux5.19.3 --> Linux6.0-rc2-1 (Experimental) Doesn't launch Plasma DE anymore - #15 by DAC324 ) to the package maintainer. For Packages / Extra / linux60-extramodules / nvidia · GitLab , there is one so I could propose the patch there.

nvidia-dkms is part of the nvidia-utils split package. I won’t be patching it for 6.0 since it’s still an early release candidate and could cause problems with other kernels.

I understand your point. However, issues with other kernels are unlikely as that patch only would lead to the drm_framebuffer.h header being included twice for them. In kernels < 6.0, the header is included when using drm_crtc.h.
This was removed in the 6.0 kernels so it has to be included separately if needed.

I just tested with 5.15 and 5.19, and for both, the patched module compiles and installs flawlessly.

1 Like

I’ve added the patch with 515.65.01-3.

2 Likes

Manjaro is booting now (after updating all package-database, mirrors and packages and installing linux 6.0 again). No need manual tweaking.

Closing.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.