Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender segfaults on start #75868

Open
jappeace opened this issue Dec 18, 2019 · 18 comments
Open

Blender segfaults on start #75868

jappeace opened this issue Dec 18, 2019 · 18 comments

Comments

@jappeace
Copy link
Contributor

Describe the bug
Blender doesn't start (exits with a segfault)

To Reproduce
Steps to reproduce the behavior:

  1. Add blender to nixpkgs
  2. switch
  3. run blender

Expected behavior
It starts.

Additional context
This gets dumped on CLI:

libGL error: MESA-LOADER: failed to open radeonsi (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: swrast
Received X11 Error:
        error code:   2
        request code: 152
        minor code:   34
        error text:   BadValue (integer parameter out of range for operation)
Writing: /tmp/blender.crash.txt
[1]    10259 segmentation fault (core dumped)  blender

cat /tmp/blender.crash.txt

# Blender 2.79 (sub 0), Unknown revision

# backtrace
blender(BLI_system_backtrace+0x30) [0x17642f0]
blender() [0xd75801]
/nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6(+0x34c50) [0x7fc03445ac50]
blender(GHOST_GetDPIHint+0) [0x177ea70]
blender(WM_window_set_dpi+0x12) [0xd94a42]
blender(ED_screen_refresh+0xea) [0x107263a]
blender(ED_screens_initialize+0x2b) [0x1072cdb]
blender(WM_check+0x60) [0xd76190]
blender(wm_homefile_read+0x391) [0xd83171]
blender(WM_init+0xf0) [0xd856f0]
blender(main+0x21a) [0xd32d5a]
/nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6(__libc_start_main+0xee) [0x7fc034447b8e]
blender(_start+0x2a) [0xd724aa]

Video driver
OpenGL renderer string: Radeon RX 570 Series (POLARIS10, DRM 3.27.0, 4.19.81, LLVM 7.1.0)

Metadata
Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.81, NixOS, 19.09.1625.0dc46b0e1c8 (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3`
 - channels(root): `"nixos-19.09.1625.0dc46b0e1c8"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
  - blender
# a list of nixos modules affected by the problem
module:

I'm working around this at the moment by running it in a docker container (in case google finds this):

docker run -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/jappie:/home/jappie -it ubuntu-blender
@kira-bruneau
Copy link
Contributor

kira-bruneau commented Jan 27, 2020

I have the same problem with Firefox and Blender using a Radeon RX 590. I've rolled back my nix channel to the last working version I have: b0bbacb. I will try bisecting to find the culprit commit.

@kira-bruneau
Copy link
Contributor

kira-bruneau commented Jan 29, 2020

I've narrowed down the last good commit to 83a5ad1, and earliest building bad commit to 3f4d1a1. The 19 commits in between don't build. It looks like something went wrong in the upgrade to gcc9.

@kira-bruneau
Copy link
Contributor

kira-bruneau commented Jan 29, 2020

I figured out the problem. I use home-manager, so I upgrade my system separately from my user packages. I was still using an old build of Firefox and Blender built with gcc8, but they're not compatible with the AMD drivers built with gcc9. Upgrading Firefox and Blender fixes the problem for me.

This seems to be related to #31189.

@turboMaCk
Copy link
Member

I'm experiencing similar issue with blender and AMD gpu drivers. I have RX 5700 XT based graphic card.

❯❯❯ glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: AMD NAVI10 (DRM 3.35.0, 5.4.13, LLVM 9.0.1)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.3.2
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5 (Compatibility Profile) Mesa 19.3.2
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 19.3.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

It seems that blender first fails to find the driver for GPU, fallbacks on software renderer (swrast) and then segfaults.

libGL error: MESA-LOADER: failed to open radeonsi (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: swrast
Writing: /tmp/blender.crash.txt
[1]    18255 segmentation fault (core dumped)  blender

In my case /tmp/blender.crash.txt is empty.

I'm using nixos-unstable.

  • system: "x86_64-linux"
  • host os: Linux 5.4.13, NixOS, 20.03pre211190.a21c2fa3ea2 (Markhor)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.2
  • channels(marek): "nixos-20.03pre211190.a21c2fa3ea2"
  • channels(root): "nixos-20.03pre211190.a21c2fa3ea2, nixos-hardware"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

@kira-bruneau
Copy link
Contributor

@jappeace and @turboMaCk, do you have blender installed with nix-env or home-manager? If so do you still have the problem after upgrading blender?

@turboMaCk
Copy link
Member

I'm not using home manager. First I tried to use just nix-env -i blender, then I added it to systemPackages in declarative NixOS configuration and had the same error in both cases. This was all on desktop where I'm also using kernel 5.4.13 (kernelPackages = pkgs.linuxPackages_5_4). On a laptop with just intel graphics (and with default kernel) it works fine (I tried nix-env -i only). I need to run 5.4 kernel on desktop because of graphic card driver but I can try to update kernel on laptop to confirm it still works there. Other than that those machines are sharing most of the configuration.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 23, 2020

I've found the same error in arx-libertatis, today.
Pinging mesa maintainer @vcunat.

@vcunat
Copy link
Member

vcunat commented Feb 23, 2020

🤔 for now I just tried it. My system is on version with gcc 9 already, kernel 5.4, using amdgpu

AMDGPU(0): [DRI2] DRI driver: radeonsi

and blender from current master starts without errors.

@vcunat
Copy link
Member

vcunat commented Feb 23, 2020

Perhaps you should start by trying to gather more logs, e.g.

env LIBGL_DEBUG=verbose blender

@jappeace
Copy link
Contributor Author

There you go:

   env LIBGL_DEBUG=verbose blender
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/jappie/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/jappie/.drirc: No such file or directory.
libGL: pci id for fd 9: 1002:67df, driver radeonsi
libGL: MESA-LOADER: failed to open /run/opengl-driver/lib/dri/radeonsi_dri.so: /nix/store/516azh1zz5zql5xkyb066b3a3sibsvsd-libdrm-2.4.99/lib/libdrm_amdgpu.so.1: undefined symbol: drmSyncobjTimelineSignal
libGL error: MESA-LOADER: failed to open radeonsi (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: radeonsi
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/jappie/.drirc: No such file or directory.
libGL: pci id for fd 9: 1002:67df, driver radeonsi
libGL: MESA-LOADER: failed to open /run/opengl-driver/lib/dri/radeonsi_dri.so: /nix/store/516azh1zz5zql5xkyb066b3a3sibsvsd-libdrm-2.4.99/lib/libdrm_amdgpu.so.1: undefined symbol: drmSyncobjTimelineSignal
libGL error: MESA-LOADER: failed to open radeonsi (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: radeonsi
libGL: MESA-LOADER: failed to open /run/opengl-driver/lib/dri/swrast_dri.so: /nix/store/516azh1zz5zql5xkyb066b3a3sibsvsd-libdrm-2.4.99/lib/libdrm_amdgpu.so.1: undefined symbol: drmSyncobjTimelineSignal
libGL error: MESA-LOADER: failed to open swrast (search paths /run/opengl-driver/lib/dri)
libGL error: failed to load driver: swrast
Received X11 Error:
        error code:   2
        request code: 152
        minor code:   34
        error text:   BadValue (integer parameter out of range for operation)
Writing: /tmp/blender.crash.txt
[1]    6875 segmentation fault (core dumped)  env LIBGL_DEBUG=verbose blender

I'm not sure what it means

@ryantrinkle
Copy link
Contributor

@jappeace For what it's worth: I encountered an issue that looked the same (i.e. missing drmSyncobjTimelineSignal) while running ffplay on a machine with amdgpu, and resolved it by upgrading to nixos-20.03. Unfortunately, I didn't get any better understanding of what was happening, but perhaps this will help anyone seeing this issue figure it out!

@jappeace
Copy link
Contributor Author

@ryantrinkle unfortunately that didn't work, I'm getting a different error now though:

$  blender   
/build/blender-2.79b/intern/ghost/intern/GHOST_WindowX11.cpp:303: X11 glXChooseVisual() failed, verify working openGL system!
initial window could not find the GLX extension
Writing: /tmp/blender.crash.txt
[1]    5048 segmentation fault (core dumped)  blender
$ cat /tmp/blender.crash.txt
   cat /tmp/blender.crash.txt 
# Blender 2.79 (sub 0), Unknown revision

# backtrace
blender(BLI_system_backtrace+0x30) [0x17642f0]
blender() [0xd75801]
/nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6(+0x34c50) [0x7f1ddda4ec50]
blender(GHOST_GetDPIHint+0) [0x177ea70]
blender(WM_window_set_dpi+0x12) [0xd94a42]
blender(ED_screen_refresh+0xea) [0x107263a]
blender(ED_screens_initialize+0x2b) [0x1072cdb]
blender(WM_check+0x60) [0xd76190]
blender(wm_homefile_read+0x391) [0xd83171]
blender(WM_init+0xf0) [0xd856f0]
blender(main+0x21a) [0xd32d5a]
/nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6(__libc_start_main+0xee) [0x7f1ddda3bb8e]
blender(_start+0x2a) [0xd724aa]

I understand what's going on, the opengl detection code is failing for some reason. I'm just not really sure how to fix it, should I open up blender to just bypass it or something? I'll probably play with that later.

I can do things like glxgears. so it's not like it doesn't exist.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Oct 21, 2020

I decided to spend a day bisecting this issue, using arx-libertatis as a reference. It looks like the problem started with the update glibc 2.27 -> 2.30, between 19.09 and 20.03. Specifically 447edaa.

I'm not 100% sure because bisecting a staging merge is tricky, but this is what came up. I don't have an explanation for how a change in glibc could cause this problem, though.

@stale
Copy link

stale bot commented Jun 7, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 7, 2021
@ben0x539
Copy link
Contributor

$ nix-shell -p blender --run 'env LIBGL_DEBUG=verbose blender'
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
intern/ghost/intern/GHOST_WindowX11.cpp:206: X11 glXChooseVisual() failed, verify working openGL system!
initial window could not find the GLX extension
Writing: /run/user/1000/blender.crash.txt
/tmp/nix-shell-10873-0/rc: line 3: 12817 Segmentation fault      (core dumped) env LIBGL_DEBUG=verbose blender

is blender missing some dependency?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 18, 2022
@apppppppple
Copy link

@ben0x539 also encountering that issue, setting hardware.opengl.extraPackages = [ pkgs.mesa.drivers ]; and installing blender through my nix config instead of through nix-shell seemed to fix the problem. https://nixos.wiki/wiki/OpenGL might be relevant.

@thedaemon
Copy link

Sorry I think I created a dupe #202907 I have amdgpu Radeon 6750XT. Same issue:

clay@claydoh:/nix/store/70yxqrmbf3bxjnfn0pbpbfyh9r5y1vkw-blender-3.3.1/bin$ ./blender Warning: Falling back to the standard locale ("C") Read prefs: /home/clay/.config/blender/3.3/config/userpref.blend intern/ghost/intern/GHOST_WindowX11.cpp:191: X11 glXChooseVisual() failed, verify working openGL system! initial window could not find the GLX extension Writing: /tmp/blender.crash.txt Segmentation fault (core dumped)

@turboMaCk
Copy link
Member

turboMaCk commented Nov 26, 2022

The issues is resolved in my case. Potentially by unrelated changes I made in graphics drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants