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

i would just try and keep the startup script simple
and try and fix the existing errors before adding more stuff

The basic stuff that I have on my startup script is able to run correctly wayland and wayfire. So it is well configured. It is a secure base. The stuff I add to that secure base is useful to experiment,to try to make work KDE6. What I do is to try to add and then remove what does not work. The reason why I'm trying to install the newer nvidia driver is because I suspect that the nvidia driver that I'm using has a bug. Or maybe is not a bug,but it is caused by some missing parameter. I don't know.
 
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.

Let me understand : should I apply the patch at commit :


is this a new patch ?
 
Let me understand : should I apply the patch at commit :


is this a new patch ?
No. the attached patch is for ports tree. Not for src tree.
And the patch is not a new one, as I already linked to the ML archive I posted before. Just uploaded here for convenience. This needs testing on src main branch before filing a bug. (Tested only on stable/14 branch for now.)

And I found nvidia released new beta driver 560.31.02. So drivers to be tested on main branch would be 550.107.02 production branch driver, 555.58.02 new feature branch driver and 560.31.02 beta branch driver. 550.107.02 and 555.58.02 is already tested on stable/14.
(Means, I won't test 560.28.03 on main branch. Now my src main branch environment is on building commit d349bd35330d.)
 
you can run wayfire and wayland

but wayfire uses wlroots as its wayland compositor
kde doesnt use wlroots

so if you have wlroots and wayland working with wayfire
then you could safely assume that you would be able to run another wlroots wayland compositor
like labwc or dwl

it also means seatd is working with wayland

but the settings working with wayfire and wlroots may not work with kde
 
I have restarted from scratch....and it worked...I've been able to use the new driver and the new drm-61.ko. Unfortunately kde6 and wayland still don't work.

Istantanea_2024-08-09_22-28-54.png


The new driver and the new drm.ko work worst than the older ones with kde6 and wayland.

Istantanea_2024-08-09_22-37-53.png
 
looking around for kde and nvidia issues these are the things that seen to crop up

have you tried the following

Code:
/boot/loader.conf

Code:
hw.nvidiadrm.modeset="1"

from this page


which also mentions you need egl-wayland installed

Code:
egl-wayland-1.1.13             EGLStream-based Wayland external platform

couple of nvidia settings to try

1 - first nvidia settings to try using export for a sh script

Code:
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia

or setenv in

Code:
~/.cshrc

Code:
setenv __NV_PRIME_RENDER_OFFLOAD 1
setenv __GLX_VENDOR_LIBRARY_NAME nvidia

2 - second nvidia settings to try using export for a sh script

Code:
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia

or setenv in

Code:
~/.cshrc

Code:
setenv GBM_BACKEND nvidia-drm
setenv __GLX_VENDOR_LIBRARY_NAME nvidia

qt6

have you got qt6-wayland installed

Code:
qt6-wayland-6.7.2              Qt6 wrapper for Wayland

starting kde and the handbook


A second method to start KDE Plasma is by manually invoking startx(1). For this to work, the following line is needed in ~/.xinitrc:

Code:
% echo "exec dbus-launch --exit-with-x11 ck-launch-session startplasma-x11" > ~/.xinitrc

you arent using X11 obviously, but that command is a good starting place

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

kde-starts script

uncomment nvidia settings 1, see if that works
then comment it back out and uncomment nvidia settings 2 and see if that does anything

Code:
#!/bin/sh

export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"

export QT_QPA_PLATFORMTHEME=qt6ct
export QT_QPA_PLATFORM=wayland

export LIBSEAT_BACKEND=consolekit2

# nvidia settings 1 - uncomment to try
#export __NV_PRIME_RENDER_OFFLOAD=1
#export __GLX_VENDOR_LIBRARY_NAME=nvidia

# nvidia settings 2 - uncomment to try
#export GBM_BACKEND=nvidia-drm
#export __GLX_VENDOR_LIBRARY_NAME=nvidia

# uncommented if needed
#export QT_WAYLAND_SHELL_INTEGRATION=xdg-shell
#export XDG_SESSION_TYPE=xdg-shell
#export WLR_NO_HARDWARE_CURSORS=1

# start dbus, console kit and startplasma-wayland
exec dbus-launch --exit-with-session ck-launch-session startplasma-wayland

The XDG_RUNTIME_DIR directory contains the wayland socket, wayland lockfile, xdg_session and a dbus-directory

Code:
# ls -l /var/run/xdg/djwilcox/
total 7
dr-xr-xr-x  11 djwilcox djwilcox 704  9 Aug 20:07 .fcdm-jail
-r--r--r--   1 djwilcox djwilcox   0  9 Aug 20:07 .fcdm-lock
srwxr-xr-x   1 djwilcox djwilcox   0  9 Aug 12:58 Alacritty-wayland-0-30915.sock
drwx------   2 djwilcox djwilcox   3  9 Aug 12:59 at-spi
drwx------   3 djwilcox djwilcox   3  9 Aug 12:58 dbus-1
drwx------   2 djwilcox djwilcox   3  9 Aug 13:52 dconf
drwx------   2 djwilcox djwilcox   2  9 Aug 13:19 doc
drwx------   2 djwilcox djwilcox   3  9 Aug 12:58 dwlb
drwx------   2 djwilcox djwilcox   3  9 Aug 12:59 emacs
drwx------   2 djwilcox djwilcox   2  9 Aug 13:52 pulse
-rw-------   1 djwilcox djwilcox   0  9 Aug 13:19 tofi.lock
srwxr-xr-x   1 djwilcox djwilcox   0  9 Aug 12:58 wayland-0
-rw-r-----   1 djwilcox djwilcox   0  9 Aug 12:58 wayland-0.lock
-rwx------   1 root     djwilcox   0  9 Aug 12:58 xdg_session.0

DBUS_SESSION_BUS_ADDRESS created with dbus-launch using code from the handbook to lauch dwl

Code:
exec dbus-launch --exit-with-session dwl -s 'dwlb -font "monospace:size=16"' 2>/dev/null

Code:
printenv

Code:
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-1GOjP79gA3,guid=fd40fb53c75aa9a931db0dfb66b6047d

Code:
ls -l /tmp

Code:
srwxrwxrwx  1 djwilcox wheel  0  9 Aug 12:58 dbus-1GOjP79gA3

the two main issue you seem to have are not finding /dev/dri/card0
and dbus errors

i wonder if the not being able to find the card is because you need to set a particular variable for nvidia
and the dbus errors are related to using dbus-launch

does the XDG_RUNTIME_DIR directory contain the following
wayland-0, wayland-0.lock and dbus-1

and does your /tmp directory contain a dbus directory

i think its just a matter of finding the right combination of settings
 
I have restarted from scratch....and it worked...I've been able to use the new driver and the new drm-61.ko. Unfortunately kde6 and wayland still don't work.

View attachment 19981

The new driver and the new drm.ko work worst than the older ones with kde6 and wayland.

View attachment 19982
Your screenshot shows that nvidia-drm.ko is not loaded.
And nvidia-smi is complaining firmware_get_flags: insufficient privileges to load firmware image nvidia_gsp_tu10x_fw.

So my next questions are:
  1. If you kldload nvidia-drm (as root), does it pull in nvidia-modeset.ko, nvidia.ko and nvidia_gsp_tu10x_fw.ko?
  2. If nvidia_gsp_tu10x_fw.ko alone is NOT auto-loaded with above, does the drivers work OK?
  3. If not, is there any differences when you manually kldloadnvidia_gsp_tu10x_fw (as root)?
Note that nvidia_gsp_tu10x_fw.ko is one of two new modules added on 560 series of beta driver. The patch I've uploaded includes fixes to install 2 new modules for 560 (and newer) series of driver.
These modules are firmware modules for GSP (GPU system processor).
Read Chapter 27. GSP Firmware of README on nvidia site.
I don't have any GPU supporting GSP (Turing or later generation is required), I even cannot try to load whichever of the firmware modules.

Edit: Fixed typo in module name. nvidia_drm was a typo of nvidia-drm.
 
Now I'm running 560.31.02 driver on src main at commit d349bd35330d.
Working fine as usual. Uploaded patch is applied, but as I already said, my GPU does not support GSP.
Now updating ports to commit cd5e44613d6a. It should take a fair amount of time, so my next shot of tests (550 and 555 series on main and 560.31.02 on stable/14) would be far behind.
 
Something is telling me that if the GPU works fine under Xorg, it should work fine under Wayland, no extra fussing required. 🤔 I did pull off KDE 5 with Wayland a few years ago, but that was with AMD GPUs.
 
FYI:
What's related with /dev/dri/* are drm.ko and nvidia-drm.ko. Not nvidia.ko nor nvidia-modeset.ko.

And sorry, my previous instruction in #309 included a typo (now fixed).
nvidia_drm should have been nvidia-drm.
 
# kldxref /boot/kernel /boot/modules
no errors,btw nvidia-drm can't be loaded.

Can you try with 14.1 ? maybe you will have the same problem as me.
Or maybe the error is because I'm using a vm.
 
# kldxref /boot/kernel /boot/modules
no errors,btw nvidia-drm can't be loaded.

Can you try with 14.1 ? maybe you will have the same problem as me.
Or maybe the error is because I'm using a vm.
Sorry, I don't have enough disk/partition to install 14.1. And usually, this kind of things mandates bare-metal environment. At least, to even try, I must purchase enough sized and fast enough memstick or NVMe SSD.

Maybe you mean your specially crafted bhyve environmen which you're trying on another thread as VM. Possibly it hurts, if anything more resources are needed to be passed through, even if it is finally possible.

Without quite deep knowledge on host OS/guest OS/VM system and hardware, or quite intelligent automated system, passing through of (non-emulated) resources is usually completely impossible.

And I have no experience about bhyve. Even if I have some experiences, I need Mate DE environment on bare-metal (host) side, so I cannot pass throug my GPU to guest.

So I recommend to try on bare-metal environment first and confirm it works as wanted, then, try passthough to the guests.
 
14.1-RELEASE-p2 --> bare metal : I see the same error. Give me your linker file,please. I want experiment. Don't worry if I break something,it's not your system ;D
 
14.1-RELEASE-p2 --> bare metal : I see the same error. Give me your linker file,please. I want experiment. Don't worry if I break something,it's not your system ;D
Turned out that I've missingly uploaded a bit old (including 2 typos) version of patch. Attach again here. Revert the previous one and apply the one attached here.

To be clear, the typo affects when attempting to build pre-560 series of drivers. So 560.28.03 (or 560.31.02) should not be affected.

And before trying (I believe meaningless) linker.hints for different branch, can you confirm (assuming you're still trying 560.28.03) the outputs of 3 commands below?

strings /boot/modules/nvidia-drm.ko | grep 560.28.03
strings /boot/modules/nvidia-modeset.ko | grep 560.28.03
strings /boot/modules/nvidia.ko | grep 560.28.03

If all of them somehow shows 560.28.03, the versions of these 3 modules matches. If not, the module which shows nothing is in different version.
 

Attachments

  • patch-nvidia-550.107.02-r2.diff.txt
    5.7 KB · Views: 18
Turned out that I've missingly uploaded a bit old (including 2 typos) version of patch. Attach again here. Revert the previous one and apply the one attached here.

To be clear, the typo affects when attempting to build pre-560 series of drivers. So 560.28.03 (or 560.31.02) should not be affected.

And before trying (I believe meaningless) linker.hints for different branch, can you confirm (assuming you're still trying 560.28.03) the outputs of 3 commands below?

strings /boot/modules/nvidia-drm.ko | grep 560.28.03
strings /boot/modules/nvidia-modeset.ko | grep 560.28.03
strings /boot/modules/nvidia.ko | grep 560.28.03

If all of them somehow shows 560.28.03, the versions of these 3 modules matches. If not, the module which shows nothing is in different version.

Without applying your new patch :

Istantanea_2024-08-11_16-13-05.png


everything is ok ? Do I need to apply your new patch ? It seems that nvidia-drm.ko does not support 14.1-RELEASE,but it works on the 14.0.
 
Back
Top