Trying to run KDE 6 Plasma with Wayland....

Most likely cause, module is out of sync with the kernel. What version of FreeBSD did you install?
 
The error is changed :
Is your /usr/src 100% in sync with installed/running kernel, means, are your running (when you're attempting to load nvidia-drm.ko) kernel and modules installed in /boot/modules built using your current (you used to build graphics/nvidia-drm-61-kmod) /usr/src?
I usually encounter your error message when I forgot to rebuild the errored out module after upgrading kernel and rebooted to multi-user (after init is started and rc script starts).

To build modules from ports sanely,
  • always keep /usr/src and installed base (kernel, in-tree modules and userland) in 100% sync,
  • build all kernel modulef from ports from the exactly same ports tree (except contents of distfiles and packages directories as they changes while fetching, building proceeds)
is important. Without this, any of the ports modules could become different layout and fail to be treated as valid kernel modules.
 
Is your /usr/src 100% in sync with installed/running kernel, means, are your running (when you're attempting to load nvidia-drm.ko) kernel and modules installed in /boot/modules built using your current (you used to build graphics/nvidia-drm-61-kmod) /usr/src?
I usually encounter your error message when I forgot to rebuild the errored out module after upgrading kernel and rebooted to multi-user (after init is started and rc script starts).

To build modules from ports sanely,
  • always keep /usr/src and installed base (kernel, in-tree modules and userland) in 100% sync,
  • build all kernel modulef from ports from the exactly same ports tree (except contents of distfiles and packages directories as they changes while fetching, building proceeds)
is important. Without this, any of the ports modules could become different layout and fail to be treated as valid kernel modules.

Can you point me to the right chapter of the handbook where is explained how to keep in synch the src ? thanks.
 
Can you point me to the right chapter of the handbook where is explained how to keep in synch the src ? thanks.
Basically, 26.6. Updating FreeBSD from Source.
If you already have src tree and want to make sure your base (kernel, in-tree modules and userland) installation is in sync, Chapter 26.6.4 to 26.6.6.3.
But I suggest to put aside make delete-old-libs until you're sure it's safe (nothing is linked with to-be-deleted old libraries).

Additional step is to rebuild/reinstall all kernel module ports AFTER make installworld and BEFORE shutdown -r now in Chapter 26.6.5.

But before you try this heavy step, you can try below.

Run dmesg | grep -A 7 BOOT
You can see the 12-digits commit hash of /usr/src used on the 5th line below ---<<BOOT>>--- line. If multiple blocks are shown, see the last one.
Then, run git reflog show on /usr/src. It would show you in which commit hash your /usr/src is.
If both matches, it usually indicates the kernel is built from the src tree.
 
Not to derail the current conversation but I am trying to run Plasma 6 with Wayland on bare metal and I hit the same issue.

I am using a i5-8265U processor with integrated graphics and have drm-515-kmod installed.
Nice! the issue has a bigger audience than the thread suggests.

BTW, your hardware seems up to the task, it's the software that needs to be ironed out.
 
My suspect is that the driver
Not to derail the current conversation but I am trying to run Plasma 6 with Wayland on bare metal and I hit the same issue.
I am using a i5-8265U processor with integrated graphics and have drm-515-kmod installed.

what's issue did you hit ? please elaborate more. My suspect is that driver 560.28.03 may require FreeBSD 15.0...
 
Bash:
#!/bin/sh

export QT_DEBUG_PLUGINS=1
export QT_LOGGING_RULES="*.debug=true"

export XDG_SESSION_TYPE="wayland"
export QT_QPA_PLATFORMTHEME=qt6ct
export QT_QPA_PLATFORM=wayland

export QT_WAYLAND_SHELL_INTEGRATION="xdg-shell"

exec ck-launch-session dbus-launch --exit-with-session startplasma-wayland
The output is huge but the relevant part is:
Code:
qt.core.plugin.factoryloader: looking at "/usr/local/lib/qt6/plugins/wayland-shell-integration/libqt-shell.so"
qt.core.plugin.loader: Found metadata in lib /usr/local/lib/qt6/plugins/wayland-shell-integration/libqt-shell.so, metadata=
{
    "IID": "org.qt-project.Qt.WaylandClient.QWaylandShellIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "qt-shell"
        ]
    },
    "archlevel": 1,
    "className": "QWaylandQtShellIntegrationPlugin",
    "debug": false,
    "version": 395008
}


qt.core.plugin.factoryloader: Got keys from plugin meta data QList("qt-shell")
qt.core.plugin.factoryloader: checking directory path "/usr/local/bin/wayland-shell-integration" ...
qt.core.library: "/usr/local/lib/qt6/plugins/wayland-shell-integration/libxdg-shell.so" loaded library
qt.qpa.wayland: Loading shell integration failed.
qt.qpa.wayland: Attempted to load the following shells QList("xdg-shell")
qt.core.library: "/usr/local/lib/qt6/plugins/wayland-shell-integration/libxdg-shell.so" loaded library
qt.qpa.wayland: Loading shell integration failed.
qt.qpa.wayland: Attempted to load the following shells QList("xdg-shell")
org.kde.startup: "kdeinit5_shutdown" QList() exited with code 255
startplasma-wayland: Shutting down...
startplasmacompositor: Shutting down...
startplasmacompositor: Done.
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.

Meaning that the plugin library was loaded, some initialization code ran and it failed. I'm looking at https://github.com/qt/qtwayland, will post details if I discover why.
 
… 560.28.03 may require FreeBSD 15.0...

No. Quite the opposite:

Code:
% uname -KU
1500023 1500023
% make
===> src (all)
===> src/nvidia (all)
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
i386 -> /usr/src/sys/i386/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/acpica/acpi_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
:> opt_acpi.h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/pci/pci_if.m -h
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -p
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -q
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -h
touch opt_global.h
/usr/local/bin/ccache cc  -O2 -pipe -O3 -pipe -march=native -mtune=native -DNV_VERSION_STRING=\"560.28.03\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O2 -fno-strict-aliasing -ffreestanding -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -DNV_SPECTRE_V2=1 -DNV_KERNEL_INTERFACE_LAYER -Werror=undef  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I../common/inc -include /tmp/NVIDIA-FreeBSD-x86_64-560.28.03/src/nvidia/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -fdebug-prefix-map=./i386=/usr/src/sys/i386/include     -MD  -MF.depend.nvidia_acpi.o -MTnvidia_acpi.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wswitch -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=gnu99 -c nvidia_acpi.c -o nvidia_acpi.o
In file included from nvidia_acpi.c:13:
./nv-freebsd.h:17:2: error: This driver does not support FreeBSD-CURRENT!
   17 | #error This driver does not support FreeBSD-CURRENT!
      |  ^
1 error generated.
*** Error code 1

Stop.
make[2]: stopped making "all" in /tmp/NVIDIA-FreeBSD-x86_64-560.28.03/src/nvidia
*** Error code 1

Stop.
make[1]: stopped making "all" in /tmp/NVIDIA-FreeBSD-x86_64-560.28.03/src
*** Error code 1

Stop.
make: stopped making "all" in /tmp/NVIDIA-FreeBSD-x86_64-560.28.03
%
 
Bash:
#!/bin/sh

export QT_DEBUG_PLUGINS=1
export QT_LOGGING_RULES="*.debug=true"

export XDG_SESSION_TYPE="wayland"
export QT_QPA_PLATFORMTHEME=qt6ct
export QT_QPA_PLATFORM=wayland

export QT_WAYLAND_SHELL_INTEGRATION="xdg-shell"

exec ck-launch-session dbus-launch --exit-with-session startplasma-wayland
The output is huge but the relevant part is:
Code:
qt.core.plugin.factoryloader: looking at "/usr/local/lib/qt6/plugins/wayland-shell-integration/libqt-shell.so"
qt.core.plugin.loader: Found metadata in lib /usr/local/lib/qt6/plugins/wayland-shell-integration/libqt-shell.so, metadata=
{
    "IID": "org.qt-project.Qt.WaylandClient.QWaylandShellIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "qt-shell"
        ]
    },
    "archlevel": 1,
    "className": "QWaylandQtShellIntegrationPlugin",
    "debug": false,
    "version": 395008
}


qt.core.plugin.factoryloader: Got keys from plugin meta data QList("qt-shell")
qt.core.plugin.factoryloader: checking directory path "/usr/local/bin/wayland-shell-integration" ...
qt.core.library: "/usr/local/lib/qt6/plugins/wayland-shell-integration/libxdg-shell.so" loaded library
qt.qpa.wayland: Loading shell integration failed.
qt.qpa.wayland: Attempted to load the following shells QList("xdg-shell")
qt.core.library: "/usr/local/lib/qt6/plugins/wayland-shell-integration/libxdg-shell.so" loaded library
qt.qpa.wayland: Loading shell integration failed.
qt.qpa.wayland: Attempted to load the following shells QList("xdg-shell")
org.kde.startup: "kdeinit5_shutdown" QList() exited with code 255
startplasma-wayland: Shutting down...
startplasmacompositor: Shutting down...
startplasmacompositor: Done.
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.

Meaning that the plugin library was loaded, some initialization code ran and it failed. I'm looking at https://github.com/qt/qtwayland, will post details if I discover why.

Can you try these parameters ?

Istantanea_2024-08-09_10-36-59.png
 
Basically, 26.6. Updating FreeBSD from Source.
If you already have src tree and want to make sure your base (kernel, in-tree modules and userland) installation is in sync, Chapter 26.6.4 to 26.6.6.3.
But I suggest to put aside make delete-old-libs until you're sure it's safe (nothing is linked with to-be-deleted old libraries).

Additional step is to rebuild/reinstall all kernel module ports AFTER make installworld and BEFORE shutdown -r now in Chapter 26.6.5.

But before you try this heavy step, you can try below.

Run dmesg | grep -A 7 BOOT
You can see the 12-digits commit hash of /usr/src used on the 5th line below ---<<BOOT>>--- line. If multiple blocks are shown, see the last one.
Then, run git reflog show on /usr/src. It would show you in which commit hash your /usr/src is.
If both matches, it usually indicates the kernel is built from the src tree.

Istantanea_2024-08-09_11-34-13.png


Istantanea_2024-08-09_11-30-53.png



Both matches ? Should I perform that heavy step ? thanks.
 
No. Quite the opposite:

Code:
% uname -KU
1500023 1500023
% make
===> src (all)
===> src/nvidia (all)
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
i386 -> /usr/src/sys/i386/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/acpica/acpi_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
:> opt_acpi.h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/pci/pci_if.m -h
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -p
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -q
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -h
touch opt_global.h
/usr/local/bin/ccache cc  -O2 -pipe -O3 -pipe -march=native -mtune=native -DNV_VERSION_STRING=\"560.28.03\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O2 -fno-strict-aliasing -ffreestanding -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -DNV_SPECTRE_V2=1 -DNV_KERNEL_INTERFACE_LAYER -Werror=undef  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I../common/inc -include /tmp/NVIDIA-FreeBSD-x86_64-560.28.03/src/nvidia/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -fdebug-prefix-map=./i386=/usr/src/sys/i386/include     -MD  -MF.depend.nvidia_acpi.o -MTnvidia_acpi.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wswitch -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=gnu99 -c nvidia_acpi.c -o nvidia_acpi.o
In file included from nvidia_acpi.c:13:
./nv-freebsd.h:17:2: error: This driver does not support FreeBSD-CURRENT!
   17 | #error This driver does not support FreeBSD-CURRENT!
      |  ^
1 error generated.
*** Error code 1

Stop.
make[2]: stopped making "all" in /tmp/NVIDIA-FreeBSD-x86_64-560.28.03/src/nvidia
*** Error code 1

Stop.
make[1]: stopped making "all" in /tmp/NVIDIA-FreeBSD-x86_64-560.28.03/src
*** Error code 1

Stop.
make: stopped making "all" in /tmp/NVIDIA-FreeBSD-x86_64-560.28.03
%
Hm, I've not yet tried 560 series of drivers on main (aka 15-Curret) yet, but running on stable/14. But ustream driver package states that they support only stable and releng branches and usually has code to reject main.

So x11/nvidia-driver has codes to drop the version check to foricibly make the driver run on main. It usually works until new stable branch is created and main branch is bumped.
See lines 169 to 172 of x11/nvidia-driver/Makefile.

My guess with cath-oderay's example is the log building the upstream driver package itself extracted on /tmp/NVIDIA-FreeBSD-x86_64-560.28.03, right?
 
View attachment 19973

View attachment 19974


Both matches ? Should I perform that heavy step ? thanks.
According your photo, both the branch (releng/14.1) and commit hash (first 12 digits are dcdea9e8623e) matches. Looks OK, unless no local modifications are done in /usr/src after the kernel was built.

If all the kernel module ports are built on this very environment at the same time (in sequence or in pararell by poudriere [or something alike]), there are no reason that unsupported file type error happenes.
 
Hm, I've not yet tried 560 series of drivers on main (aka 15-Curret) yet, but running on stable/14. But ustream driver package states that they support only stable and releng branches and usually has code to reject main.

So x11/nvidia-driver has codes to drop the version check to foricibly make the driver run on main. It usually works until new stable branch is created and main branch is bumped.
See lines 169 to 172 of x11/nvidia-driver/Makefile.

My guess with cath-oderay's example is the log building the upstream driver package itself extracted on /tmp/NVIDIA-FreeBSD-x86_64-560.28.03, right?

For sure on 15-CURRENT it will not work. I mean,560.28.03 could be for 15-RELEASE or STABLE,I suppose.
 
According your photo, both the branch (releng/14.1) and commit hash (first 12 digits are dcdea9e8623e) matches. Looks OK, unless no local modifications are done in /usr/src after the kernel was built.

If all the kernel module ports are built on this very environment at the same time (in sequence or in pararell by poudriere [or something alike]), there are no reason that unsupported file type error happenes.

I don't use poudriere.
 
For sure on 15-CURRENT it will not work. I mean,560.28.03 could be for 15-RELEASE or STABLE,I suppose.
Although I've been unable to take time to give a shot on main (15-Current) yet, my assumption is that it would work as usual when built via x11/nvidia-driver, overriding driver version.
At least, 555.58 New Feature Branch driver worked for me on main, unlocking the OSVERSION check by x11/nvidia-driver port which I already mentioned on comment #290.
 
I don't use poudriere.
It does not matter. Just an example of builders.
What's important is that all kernel module ports are built with same src tree and ports tree to work with sanely.
You can build them, fulfilling the above requirements, by either direct make on each ports directories, by pkg_replace, by portmaster, by portupgrade, by poudriere, by jenkins or by synth, whichever you want.
 
These are the parameters that I'm using right now :

View attachment 19972

This is what happens to me adding your lines :

View attachment 19970

errors

1 - unable to auto launch dbus daemon without a $DISPLAY for X11

looks like dbus is trying to use $DISPLAY which isnt set because you are trying to launch Wayland
$DISPLAY is only for X11, so you shouldnt get that error using Wayland

i would imagine thats related to how you are starting dbus
and environmental variables not being set for wayland

Code:
dbus-run-session startplasma-wayland

instead of using

Code:
dbus-launch --exit-with-session dwl

which is what i have used to start every wayland compisor i have tried dwl, wayfire, labwc and hikari

Code:
dbus-launch --exit-with-session startplasma-wayland

you are still setting the XDG_RUNTIME_DIR set to the old location of /var/run/user/1001

dont set the XDG_RUNTIME_DIR in your startup script
as i said Freebsd 14.2 creates the XDG_RUNTIME_DIR and exports the variable

Code:
/var/run/xdg/username

you should use the new location for XDG_RUNTIME_DIR
otherwise if you use the old location you have to manually create the directory and set the permissions ( which a lot of people forget )

2 - pipewire

dont try starting pipewire before you get kde working
you can always look at that after you get the desktop working

3 - wireplumber not found

dont try starting wireplumber until you get kde working
wireplumber is used to replace pulseaudio with pipewire

you also have to copy config files into place to use wireplumber

my notes on setting up wireplumber on ubuntu


4 - xdg-desktop-portal-kde: not found

you shouldnt need to start the xdg-desktop-portal-kde
the desktop should handle that
 
errors

1 - unable to auto launch dbus daemon without a $DISPLAY for X11

looks like dbus is trying to use $DISPLAY which isnt set because you are trying to launch Wayland
$DISPLAY is only for X11, so you shouldnt get that error using Wayland

i would imagine thats related to how you are starting dbus
and environmental variables not being set for wayland

Code:
dbus-run-session startplasma-wayland

instead of using

Code:
dbus-launch --exit-with-session dwl

which is what i have used to start every wayland compisor i have tried dwl, wayfire, labwc and hikari

Code:
dbus-launch --exit-with-session startplasma-wayland

you are still setting the XDG_RUNTIME_DIR set to the old location of /var/run/user/1001

dont set the XDG_RUNTIME_DIR in your startup script
as i said Freebsd 14.2 creates the XDG_RUNTIME_DIR and exports the variable

Code:
/var/run/xdg/username

you should use the new location for XDG_RUNTIME_DIR
otherwise if you use the old location you have to manually create the directory and set the permissions ( which a lot of people forget )

2 - pipewire

dont try starting pipewire before you get kde working
you can always look at that after you get the desktop working

3 - wireplumber not found

dont try starting wireplumber until you get kde working
wireplumber is used to replace pulseaudio with pipewire

you also have to copy config files into place to use wireplumber

my notes on setting up wireplumber on ubuntu


4 - xdg-desktop-portal-kde: not found

you shouldnt need to start the xdg-desktop-portal-kde
the desktop should handle that

There aren't errors. Those parameters worked for jsm. Give a look at his post here :


I've used the same parameters. But probably I used them on the wrong place,I don't know. I asked him where should I put them,but he didn't reply yet. In the while I have patched pipewire and I've installed wireplumber. Regarding "xdg-desktop-portal-kde",in my system is located in a different place than jsm. So,I have fixed 3 errors,but anyway,it still does not work because error 1 :

1 - unable to auto launch dbus daemon without a $DISPLAY for X11

this error still persists,even if I added also this parameter at the beginning of the script : export $(dbus-launch)
 
It does not matter. Just an example of builders.
What's important is that all kernel module ports are built with same src tree and ports tree to work with sanely.
You can build them, fulfilling the above requirements, by either direct make on each ports directories, by pkg_replace, by portmaster, by portupgrade, by poudriere, by jenkins or by synth, whichever you want.

ok. it seems that everything has been done correctly but it does not work and we don't know why and how to fix it. Is this true ?
 
ok. it seems that everything has been done correctly but it does not work and we don't know why and how to fix it. Is this true ?
I don't have exactly the same environment as you on hand. And I've already seen your wrongly edited/patched Makefile etc. several times. So cannot be sure your (at least) ports tree is in the correct state.

But on the hardware HW probe of Lenovo ThinkPad P52 20M9CTO... #676f16ac86, stable/14 amd64 at commit 644d81447118,
with Mate DE and compiz (on xorg, not Wayland), nvidia-driver 560.28.03 and nvidia-drm-61-kmod is running. Attached patch is applied and /usr/ports/x11/nvidia-driver/Makefile.version is edited as below.
Makefile:
# NVIDIA Distversion
#
# This will be included from x11/nvidia-driver and the nvidia-drm port
NVIDIA_DISTVERSION = 560.28.03

Ports tree is on main branch at commit b7fcdc240b32.

Note that iGPU is disabled with UEFI firmware config. Running nvidia dGPU (Quadro P1000) only.
 

Attachments

  • patch-nvidia-550.107.02.diff.txt
    5.7 KB · Views: 13
Back
Top