Crash on Wayland with Vulkan apps

Distro: EndeavourOS (Arch based)
Driver version: 550.54.14-4

OpenGL works, Vulkan through xwayland works, just not native wayland Vulkan.

Output of vkcube-wayland

Selected GPU 0: NVIDIA GeForce GTX 1650, type: DiscreteGpu
fish: Job 1, 'vkcube-wayland' terminated by signal SIGSEGV (Address boundary error)

Stack trace of core dump:

Stack trace of thread 4246:
#0  0x00007b39aeb33543 n/a (libnvidia-glcore.so.550.54.14 + 0xd33543)
#1  0x000061d8d29f8847 n/a (vkcube-wayland + 0x8847)
#2  0x000061d8d29f5bed n/a (vkcube-wayland + 0x5bed)
#3  0x00007b39affa5cd0 n/a (libc.so.6 + 0x25cd0)
#4  0x00007b39affa5d8a __libc_start_main (libc.so.6 + 0x25d8a)
#5  0x000061d8d29f77d5 n/a (vkcube-wayland + 0x77d5)
  
Stack trace of thread 4251:
#0  0x00007b39b0007ebe n/a (libc.so.6 + 0x87ebe)
#1  0x00007b39b000a750 pthread_cond_wait (libc.so.6 + 0x8a750)
#2  0x00007b39ae7f340c n/a (libnvidia-glcore.so.550.54.14 + 0x9f340c)
#3  0x00007b39aec26255 n/a (libnvidia-glcore.so.550.54.14 + 0xe26255)
#4  0x00007b39ae7f5924 n/a (libnvidia-glcore.so.550.54.14 + 0x9f5924)
#5  0x00007b39b000b55a n/a (libc.so.6 + 0x8b55a)
#6  0x00007b39b0088a3c n/a (libc.so.6 + 0x108a3c)
  
Stack trace of thread 4249:
#0  0x00007b39b0007ebe n/a (libc.so.6 + 0x87ebe)
#1  0x00007b39b000aa65 pthread_cond_timedwait (libc.so.6 + 0x8aa65)
#2  0x00007b39ae7f346c n/a (libnvidia-glcore.so.550.54.14 + 0x9f346c)
#3  0x00007b39aec2b8a1 n/a (libnvidia-glcore.so.550.54.14 + 0xe2b8a1)
#4  0x00007b39ae7f5924 n/a (libnvidia-glcore.so.550.54.14 + 0x9f5924)
#5  0x00007b39b000b55a n/a (libc.so.6 + 0x8b55a)
#6  0x00007b39b0088a3c n/a (libc.so.6 + 0x108a3c)
  
Stack trace of thread 4250:
#0  0x00007b39b0007ebe n/a (libc.so.6 + 0x87ebe)
#1  0x00007b39b000aa65 pthread_cond_timedwait (libc.so.6 + 0x8aa65)
#2  0x00007b39ae7f346c n/a (libnvidia-glcore.so.550.54.14 + 0x9f346c)
#3  0x00007b39aec3c681 n/a (libnvidia-glcore.so.550.54.14 + 0xe3c681)
#4  0x00007b39ae7f5924 n/a (libnvidia-glcore.so.550.54.14 + 0x9f5924)
#5  0x00007b39b000b55a n/a (libc.so.6 + 0x8b55a)
#6  0x00007b39b0088a3c n/a (libc.so.6 + 0x108a3c)
  
Stack trace of thread 4252:
#0  0x00007b39b0007ebe n/a (libc.so.6 + 0x87ebe)
#1  0x00007b39b000aa65 pthread_cond_timedwait (libc.so.6 + 0x8aa65)
#2  0x00007b39ae7f346c n/a (libnvidia-glcore.so.550.54.14 + 0x9f346c)
#3  0x00007b39aec1009d n/a (libnvidia-glcore.so.550.54.14 + 0xe1009d)
#4  0x00007b39ae7f5924 n/a (libnvidia-glcore.so.550.54.14 + 0x9f5924)
#5  0x00007b39b000b55a n/a (libc.so.6 + 0x8b55a)
#6  0x00007b39b0088a3c n/a (libc.so.6 + 0x108a3c)
  
Stack trace of thread 4253:
#0  0x00007b39b0007ebe n/a (libc.so.6 + 0x87ebe)
#1  0x00007b39b000aa65 pthread_cond_timedwait (libc.so.6 + 0x8aa65)
#2  0x00007b39ae7f346c n/a (libnvidia-glcore.so.550.54.14 + 0x9f346c)
#3  0x00007b39aed076d4 n/a (libnvidia-glcore.so.550.54.14 + 0xf076d4)
#4  0x00007b39aecf47b6 n/a (libnvidia-glcore.so.550.54.14 + 0xef47b6)
#5  0x00007b39ae7f5924 n/a (libnvidia-glcore.so.550.54.14 + 0x9f5924)
#6  0x00007b39b000b55a n/a (libc.so.6 + 0x8b55a)
#7  0x00007b39b0088a3c n/a (libc.so.6 + 0x108a3c) 

Other information:
My machine uses both an intel igpu and nvidia dgpu, I have my install set to use the dgpu by default for everything.

Obligatory question… do you have the nvidia-drm kernel module loaded with the parameter “modeset=1”? You can check by reading /sys/module/nvidia_drm/parameters/modeset which should print “Y”.

It prints N. lsmod | grep nvidia_drm shows it is being loaded.
How can I change the parameter? I’m using systemd
I’ve tried editing both /efi/loader/loader.conf and /etc/modprobe.d/nvidia.conf to have settings nvidia-drm modeset=1, but neither worked

In /etc/modprobe.d/nvidia.conf, replace “settings” with “options”

That didn’t work either

For some other information that might be useful, here’s sudo dmesg | grep -i nvidia

[    0.890958] nvidia: loading out-of-tree module taints kernel.
[    0.890966] nvidia: module license 'NVIDIA' taints kernel.
[    0.890970] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    0.890971] nvidia: module license taints kernel.
[    1.035560] nvidia-nvlink: Nvlink Core is being initialized, major device number 242
[    1.036445] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[    1.084624] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  550.54.14  Thu Feb 22 01:44:30 UTC 2024
[    1.189520] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  550.54.14  Thu Feb 22 01:25:25 UTC 2024
[    1.191484] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    1.191486] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
[    1.198523] nvidia_uvm: module uses symbols nvUvmInterfaceDisableAccessCntr from proprietary module nvidia, inheriting taint.
[    1.280017] nvidia-uvm: Loaded the UVM driver, major device number 238.
[    4.243505]  videodev cec vfat intel_lpss i2c_i801 mdio_devres snd spi_intel_pci processor_thermal_mbox pcspkr fat wmi_bmof mousedev spi_intel cfg80211 ideapad_laptop soundcore videobuf2_common mei_me idma64 ecdh_generic intel_gtt libphy intel_vsec intel_soc_dts_iosf i2c_smbus platform_profile igen6_edac mc mei rfkill joydev int3400_thermal intel_hid hid_logitech_hidpp int3403_thermal intel_pmc_core sparse_keymap acpi_thermal_rel int340x_thermal_zone acpi_pad mac_hid fuse loop dm_mod nfnetlink ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 hid_logitech_dj pkcs8_key_parser nvidia_uvm(POE) nvme nvidia_drm(POE) nvidia_modeset(POE) nvme_core nvme_auth hid_generic usbhid nvidia(POE) crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic gf128mul ghash_clmulni_intel sha512_ssse3 serio_raw sha256_ssse3 sha1_ssse3 atkbd libps2 aesni_intel vivaldi_fmap crypto_simd cryptd xhci_pci vmd xhci_pci_renesas i2c_hid_acpi i2c_hid i8042 video serio wmi pinctrl_tigerlake i2c_dev crypto_user
[    4.245234]  videodev cec vfat intel_lpss i2c_i801 mdio_devres snd spi_intel_pci processor_thermal_mbox pcspkr fat wmi_bmof mousedev spi_intel cfg80211 ideapad_laptop soundcore videobuf2_common mei_me idma64 ecdh_generic intel_gtt libphy intel_vsec intel_soc_dts_iosf i2c_smbus platform_profile igen6_edac mc mei rfkill joydev int3400_thermal intel_hid hid_logitech_hidpp int3403_thermal intel_pmc_core sparse_keymap acpi_thermal_rel int340x_thermal_zone acpi_pad mac_hid fuse loop dm_mod nfnetlink ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 hid_logitech_dj pkcs8_key_parser nvidia_uvm(POE) nvme nvidia_drm(POE) nvidia_modeset(POE) nvme_core nvme_auth hid_generic usbhid nvidia(POE) crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic gf128mul ghash_clmulni_intel sha512_ssse3 serio_raw sha256_ssse3 sha1_ssse3 atkbd libps2 aesni_intel vivaldi_fmap crypto_simd cryptd xhci_pci vmd xhci_pci_renesas i2c_hid_acpi i2c_hid i8042 video serio wmi pinctrl_tigerlake i2c_dev crypto_user
[   25.041102] vkcube-wayland[2109]: segfault at 150 ip 000079be16733543 sp 00007ffee4a16058 error 4 in libnvidia-glcore.so.550.54.14[79be15e00000+c00000] likely on CPU 4 (core 0, socket 0)

One of my friends helped me with it, I needed to edit /etc/kernel/cmdline and append nvidia-drm.modeset=1 then sudo rebuild-kernels

Though, now, I’m having an issue on the vulkan game I’m developing, where if I don’t wait for vsync, the program will freeze. This doesn’t occur under xwayland or x11

Are you using mailbox or immediate mode?

I’m using whatever the default for SDL is

Does it work if you have it use the Intel GPU instead of the NVIDIA GPU?

prime-run still uses the nvidia gpu on vulkan, even though it uses the intel gpu on opengl.
My other laptop, which only has an intel igpu, runs it completely fine, though

I got it working on my intel igpu, everything works just fine on it.
Everything also works fine in x11, still