Segfault on default app on NixOS/NVIDIA GPU.
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## 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 :
```rust
use bevy::{app::App, DefaultPlugins};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.run();
}
```
using the nix shell
```nix
{ pkgs ? import { } }:
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}";
}
```
```sh
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)
```
Contributor guide
Research direction
Start by reproducing the default Bevy app from the issue body with the provided Nix shell and `cargo run`, then inspect the Vulkan and NVIDIA-related log output. The issue is done when the segmentation fault can be reproduced and its cause or a targeted fix is identified, with a useful diagnostic or regression test added if the project supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- computer-graphics, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100