NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.42k stars 12.92k forks source link

Vulkan not working on switchable nvidia graphics on System76 Gazelle #321995

Open matteobongio opened 5 days ago

matteobongio commented 5 days ago

Describe the bug

I cannot get vulkan to work, when I run vkcube-wayland I get:

Selected GPU 1: NVIDIA GeForce RTX 3050 Laptop GPU, type: DiscreteGpu
Can't find our preferred formats... Falling back to first exposed format. Rendering may be incorrect.
fish: Job 1, 'vkcube-wayland' terminated by signal SIGSEGV (Address boundary error)

when I run vulkan-info --summary I get these errors:

WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /nix/store/fh3p3s1gg0ick2f295zfwi2jlr78166r-mesa-24.1.1-drivers/lib/libvulkan_dzn.so. Skipping this driver.
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /nix/store/fh3p3s1gg0ick2f295zfwi2jlr78166r-mesa-24.1.1-drivers/lib/libvulkan_virtio.so. Skipping this driver.
ERROR while creating surface for extension VK_KHR_xcb_surface : /build/source/vulkaninfo/./vulkaninfo.h:245:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
ERROR while creating surface for extension VK_KHR_xlib_surface : /build/source/vulkaninfo/./vulkaninfo.h:245:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
ERROR while creating surface for extension VK_KHR_wayland_surface : /build/source/vulkaninfo/./vulkaninfo.h:245:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN

Steps To Reproduce

Steps to reproduce the behavior: I am using flakes on nixos-unstable with nixos-hardware. link to the graphics setup I am the one that wrote this, I'm hoping to fix it.

Expected behavior

vkcube is supposed to render.

Additional context

13th Gen Intel® Core™ i9-13900H NVIDIA GeForce RTX 3050 (laptop) link to my config

Notify maintainers

@k900 @SuperSandro2000 @aidalgol

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.33, NixOS, 24.11 (Vicuna), 24.11.20240613.e9ee548`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/qqwr649pc0qprc9lw2fmdsi1km6p7q2h-source`

Add a :+1: reaction to issues you find important.

K900 commented 5 days ago

This is really a question for Nvidia driver maintainers, not vulkan-loader maintainers.

matteobongio commented 5 days ago

Who should I @ ? I wasn't sure so I git blamed nixos/modules/hardware/video/nvidia.nix

VeilSilence commented 5 days ago

Try VK_DRIVER_FILES="/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json" and then run vkcube-wayland

matteobongio commented 5 days ago

same issue

Selected GPU 0: NVIDIA GeForce RTX 3050 Laptop GPU, type: DiscreteGpu
Can't find our preferred formats... Falling back to first exposed format. Rendering may be incorrect.
fish: Job 1, 'VK_DRIVER_FILES="/run/opengl-dr…' terminated by signal SIGSEGV (Address boundary error)