NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.97k stars 13.98k forks source link

Blender crash when using EEVEE renderer #337683

Closed iamtoaster closed 1 month ago

iamtoaster commented 1 month ago

Describe the bug

When trying to switch to material preview mode or rendered mode with EEVEE renderer selected blender crashes.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Open Blender;
  2. In the top-right select "Material Preview" viewport shading mode.

Expected behavior

Different shading mode does not cause a crash

Additional context

I have an nvidia GPU, have this in my config:

nixpkgs.config.cudaSupport = true;

hardware.graphics = {
  enable = true;
  extraPackages = with pkgs; [
    vaapiVdpau
  ];
};

services.xserver.videoDrivers = ["nvidia" "intel"];

hardware.nvidia = {
  modesetting.enable = true;
  powerManagement.enable = false;
  powerManagement.finegrained = false;
  open = false;
  nvidiaSettings = true;
  package = config.boot.kernelPackages.nvidiaPackages.stable;
};

Blender works fine (does not crash upon selection) if Cycles is selected as the renderer and you select Rendered viewport shading.

Here is what is printed into console on crash While I have a few addons installed, I do not think they are the issue as when I disable all installed addons before switching to material preview blender still crashes ```console [user@computer] [19:53:40] [~] -> % blender HardOps 0.9.88.5 available! P33524:19:53:46:polygoniq.bl_ext.extensions_polygoniq_com.engon:INFO: [__init__.py:64] polygoniq root logger initialized in module "bl_ext.extensions_polygoniq_com.engon", file "/home/user/.config/blender/4.2/extensions/extensions_polygoniq_com/engon/__init__.py" ----- engon addon: Verbose is enabled engon addon: Read in JSON settings from file Reloading external rigs... Reloading external metarigs... P33524:19:53:47:polygoniq.bl_ext.extensions_polygoniq_com.engon.asset_registry:INFO: [asset_registry.py:458] Refreshing registered asset packs from pack-info files: {'/home/user/data2/blender3/botaniq-installed/botaniq_full/botaniq_full.pack-info'} Writing userprefs: "/home/user/.config/blender/4.2/config/userpref.blend" ok Info: Preferences saved Warning "lock exists (lock is already held by this session)" locking "/home/user/.config/blender/4.2/extensions/extensions_polygoniq_com" Warning "lock exists (lock is already held by this session)" locking "/home/user/.config/blender/4.2/extensions/extensions_polygoniq_com" Compilation Subprocess: Failed to load cached shader binary _11345147631707559476_ Compilation Subprocess: Failed to load cached shader binary _15363902045250689707_5334095015705141289_ Writing: /tmp/blender.crash.txt [1] 33524 segmentation fault (core dumped) blender [user@computer] [19:53:53] [~] -> % Compilation Subprocess: Lost parent process Compilation Subprocess: Lost parent process Compilation Subprocess: Lost parent process Compilation Subprocess: Lost parent process Compilation Subprocess: Lost parent process Compilation Subprocess: Lost parent process Compilation Subprocess: Lost parent process ```
Contents of blender.crash.txt ```console [user@dizzpc] [20:01:33] [~] -> % cat /tmp/blender.crash.txt # Blender 4.2.0, Unknown revision bpy.context.space_data.shading.type = 'RENDERED' # Property # backtrace /etc/profiles/per-user/user/bin/blender() [0xdf43f3] /etc/profiles/per-user/user/bin/blender() [0x68c41d] /nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52/lib/libc.so.6(+0x405c0) [0x7fdd1e4495c0] /nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52/lib/libc.so.6(+0xb357a) [0x7fdd1e4bc57a] /etc/profiles/per-user/user/bin/blender() [0xdf3ea4] /etc/profiles/per-user/user/bin/blender() [0xdf403a] /etc/profiles/per-user/user/bin/blender() [0x3cbe0fa] /etc/profiles/per-user/user/bin/blender() [0x3ca66fb] /etc/profiles/per-user/user/bin/blender() [0x3cb05d3] /etc/profiles/per-user/user/bin/blender() [0x3cb08ec] /etc/profiles/per-user/user/bin/blender() [0x10239f5] /etc/profiles/per-user/user/bin/blender() [0xfdc2d5] /etc/profiles/per-user/user/bin/blender() [0xfc9691] /etc/profiles/per-user/user/bin/blender() [0xf97ffe] /etc/profiles/per-user/user/bin/blender() [0xf9b3cd] /etc/profiles/per-user/user/bin/blender() [0x2093555] /etc/profiles/per-user/user/bin/blender() [0x1544abf] /etc/profiles/per-user/user/bin/blender() [0xe4b304] /etc/profiles/per-user/user/bin/blender() [0xe46180] /etc/profiles/per-user/user/bin/blender() [0x63be72] /nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52/lib/libc.so.6(+0x2a14e) [0x7fdd1e43314e] /nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52/lib/libc.so.6(__libc_start_main+0x89) [0x7fdd1e433209] /etc/profiles/per-user/user/bin/blender() [0x6877a5] # Python backtrace [user@dizzpc] [20:01:34] [~] -> % ```

Notify maintainers

@veprbl @amarshall

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.47, NixOS, 24.11 (Vicuna), 24.11.20240824.d0e1602`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `""`
 - nixpkgs: `/nix/store/ia1zpg1s63v6b3vin3n7bxxjgcs51s2r-source`

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

amarshall commented 1 month ago

I cannot reproduce on Intel, AMD, or Nvidia GPUs, using Blender 4.2.1.

iamtoaster commented 1 month ago
* Does only preview crash, or does rendering also crash?

Yes, rendering also crashes, but only if EEVEE is selected as the renderer (Cycles works fine)

  • Try starting with blender --factory-startup (will ignore user config). This... Fixed the issue. Which is rether interesting seeing as my blender config has minimal changes compared to factory one, in fact, it is just the addons I use, CUDA and the statistics on the status bar. Is there a way to run a diff between stock settings and my settings?

I tried disabling all enabled addons, and the crash still happened.

* Try rebooting if you haven’t since last nixpkgs update to rule out driver mismatch issues.

Did not help.

* “Failed to load cached shader binary” seems suspect, but reading the source it deletes the file that failed to load. It might be a symptom rather than a cause, though, or just unrelated.

The crash happens when the UI says in the top left "Compiling EEVEE Engine Shaders"

In conclusion, I think the issue is not with nixpkgs but rather upstream. I will remake my config from scratch, hopefully everything will be fine this time. I will also be closing this issue, thank you for the help.