Skip to content

Segfault on default app on NixOS/NVIDIA GPU. #13753

@Azercoco

Description

@Azercoco

Bevy version

bevy = "0.13.2"

[Optional] Relevant system information

  • NixOS 24.11
  • cargo 1.77.1
  • DE : KDE Plasma 6.05 Wayland
  • AdapterInfo { name: "NVIDIA GeForce RTX 4070", vendor: 4318, device: 10118, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "555.42.02", backend: Vulkan }
  • Maybe relevant (it sometimes causes issues)? HiDPI monitor (4K)

What you did

I did try to launch the default app :

use bevy::{app::App, DefaultPlugins};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .run();
}

using the nix shell

{ pkgs ? import <nixpkgs> { } }:

with pkgs;

mkShell rec {
  nativeBuildInputs = [
    pkg-config
    cargo
    rustc
    rustfmt
  ];
  buildInputs = [
    udev
    alsa-lib
    vulkan-loader
    xorg.libX11
    xorg.libXcursor
    xorg.libXi
    xorg.libXrandr # To use the x11 feature
    libxkbcommon
    wayland # To use the wayland feature
  ];
  LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
  RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
}
nix-shell
cargo run

What went wrong

The application compiles without issue but when I launches it, the window open for a couple of second before encountering a segfault. I am not sure if the issue is Nix-OS related or NVIDIA related. The lack of useful log or similar issues make it very hard to troubleshoot.

Additional information

Logs :

2024-06-08T18:35:51.367195Z  WARN log: error setting XSETTINGS; Xft options won't reload automatically    
2024-06-08T18:35:51.376218Z  INFO bevy_winit::system: Creating new window "App" (0v1)
2024-06-08T18:35:51.376396Z  INFO log: Guessed window scale factor: 1.5    
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
2024-06-08T18:35:51.543181Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 4070", vendor: 4318, device: 10118, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "555.42.02", backend: Vulkan }
2024-06-08T18:32024-06-08T18:35:51.367195Z  WARN log: error setting XSETTINGS; Xft options won't reload automatically    
2024-06-08T18:35:51.376218Z  INFO bevy_winit::system: Creating new window "App" (0v1)
2024-06-08T18:35:51.376396Z  INFO log: Guessed window scale factor: 1.5    
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
2024-06-08T18:35:51.543181Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 4070", vendor: 4318, device: 10118, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "555.42.02", backend: Vulkan }
2024-06-08T18:35:51.900316Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 24.11 NixOS", kernel: "6.6.32", cpu: "Intel(R) Core(TM) i7-14700KF", core_count: "20", memory: "46.9 GiB" }
Segmentation fault (core dumped)5:51.900316Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 24.11 NixOS", kernel: "6.6.32", cpu: "Intel(R) Core(TM) i7-14700KF", core_count: "20", memory: "46.9 GiB" }
Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-BugAn unexpected or incorrect behaviorC-Machine-SpecificThis bug is isolated to specific hardware or driver configurationsO-LinuxSpecific to the Linux desktop operating systemS-Needs-ReviewNeeds reviewer attention (from anyone!) to move forward

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions