Bug 2237821

Summary: blender core dumps at execution instead of giving sane feedback about unsupported hardware
Product: [Fedora] Fedora Reporter: havealoha+fedoraproject
Component: blenderAssignee: Luya Tshimbalanga <luya_tfz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: code, design-devel, epel-packagers-sig, luya_tfz, marcan, negativo17
Target Milestone: ---   
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: blender-3.3.14-1.el9 blender-3.6.7-1.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-17 00:36:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output from commands as requested
none
more output from commands none

Description havealoha+fedoraproject 2023-09-07 05:23:13 UTC
blender core dumps at execution instead of giving sane feedback about unsupported hardware

Reproducible: Always

Steps to Reproduce:
1. install asahi fedora remix 38 on macbook air m1n1
2. install and launch blender

Actual Results:  
core dump

Expected Results:  
blender should return an error about unsupported hardware and or unsupported OpenGL version

https://discussion.fedoraproject.org/t/blender-crashes-on-latest-build-and-bug-filer-gives-error/89177

BLT_lang_init: 'locale' data path for translations not found, continuing
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
EGL Error (0x3009): EGL_BAD_MATCH: Arguments are inconsistent (for example, a valid context requires buffers n
ot supplied by a valid surface).
Warning: No OpenGL vendor detected.
blender: ../src/dispatch_common.c:872: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or E
GL context.\n"' failed.
Aborted (core dumped)

# Asahi Linux System Diagnostic Dump

    Collected at:   Wed Sep  6 20:44:45 PDT 2023 (2023-09-06T20:44:45-07:00)
    Username:
    Hostname:       makukumba

## Device information
    Model:          Apple MacBook Air (M1, 2020)
    Compatible:     apple,j313 apple,t8103 apple,arm-platform

## Firmware versions
    iBoot1:         iBoot-8422.141.2
    iBoot2:         iBoot-8422.141.2
    SFR:            13.5
    OS firmware:    13.5
    m1n1 stage 2:   v1.3.3
    U-Boot:         2023.07

## Boot information
    ESP UUID:       745b90c8-7d4a-4418-b5ea-74fbcf0d0483
    EFI:            available

## System information
    Kernel:         6.4.11-401.asahi.fc38.aarch64+16k
    Kernel build:   #1 SMP PREEMPT_DYNAMIC Mon Aug 21 19:38:10 UTC 2023
    Uptime:          20:44:45 up 22:36,  3 users,  load average: 0.70, 0.59, 0.46
    Kernel cmdline: BOOT_IMAGE=(hd0,gpt5)/boot/vmlinuz-6.4.11-401.asahi.fc38.aarch64+16k rhgb quiet root=UUID=86ad63d7-5618-4548-8ba8-78d68efa4738 rootflags=subvol=root

## Environment
    COLORTERM=truecolor
    DISPLAY=:0
    LANG=C.UTF-8
    LANGUAGE=
    TERM=xterm-256color
    WAYLAND_DISPLAY=wayland-0
    XDG_SESSION_TYPE=wayland

## Mounts
```

## PCI devices
```
00:00.0 PCI bridge: Apple Inc. Apple Silicon PCI Express Root Port (rev 01)
01:00.0 Network controller: Broadcom Inc. and subsidiaries BRCM4378 Wireless Network Adapter (rev 03)
01:00.1 Network controller: Broadcom Inc. and subsidiaries BRCM4378 Bluetooth Controller (rev 03)
```

## Input devices
```
I: Bus=001c Vendor=05ac Product=0281 Version=0935
N: Name="Apple Internal Keyboard / Trackpad"
P: Phys=spi1.0 (2)
S: Sysfs=/devices/platform/soc/23510c000.spi/spi_master/spi1/spi1.0/001C:05AC:0281.0002/input/input0
U: Uniq=
H: Handlers=mouse0 event0 
B: PROP=5
B: EV=1b
B: KEY=e520 10000 0 0 0 0
B: ABS=67f800001000003
B: MSC=10

I: Bus=001c Vendor=05ac Product=0281 Version=0935
N: Name="Apple Internal Keyboard / Trackpad"
P: Phys=spi1.0 (1)
S: Sysfs=/devices/platform/soc/23510c000.spi/spi_master/spi1/spi1.0/001C:05AC:0281.0001/input/input1
U: Uniq=
H: Handlers=sysrq kbd leds event1 
B: PROP=0
B: EV=120013
B: KEY=10000 0 0 0 101007b02011007 ff9f21fac14057ff ffbeffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=1f

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="Apple SMC power/lid events"
P: Phys=macsmc-hid (0)
S: Sysfs=/devices/platform/soc/23e400000.smc/macsmc-hid/input/input2
U: Uniq=
H: Handlers=kbd event2 
B: PROP=0
B: EV=23
B: KEY=10000000000000 0
B: SW=1

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="MacBook Air J313 Headphone Jack"
P: Phys=ALSA
S: Sysfs=/devices/platform/sound/sound/card0/input3
U: Uniq=
H: Handlers=event3 
B: PROP=0
B: EV=21
B: SW=14
```

Comment 1 Nicolas Chauvet (kwizart) 2023-09-07 09:50:41 UTC
Can you report the glxinfo or eglinfo on the device ?
Also which kernel do you use ? a fedora kernel built for 

My guess is that mesa advertise the support based on assumption to use a downstream kernel (with Asahi patches).

So the crash is because mesa "lies" on the GL support.
(now it's just a wild guess).

Comment 2 havealoha+fedoraproject 2023-09-08 00:36:03 UTC
uname -a (generic asahi kernel)
glxinfo
eglinfo

pasted into below:

https://pastebin.com/hxZAiACe

Comment 3 havealoha+fedoraproject 2023-09-10 23:27:37 UTC
Created attachment 1988053 [details]
output from commands as requested

output from commands as requested

Comment 4 havealoha+fedoraproject 2023-09-10 23:30:12 UTC
Created attachment 1988054 [details]
more output from commands

Comment 5 Hector Martin 2023-09-11 14:30:22 UTC
Our Mesa advertises the correct GL version support (3.1 at this time) when the kernel/etc is correct (if the kernel is wrong it falls back to llvmpipe which *can* run blender in software, very slowly).

Blender is *not* supposed to work because it needs a higher GL version. The problem is that I guess it requests a higher version, and when it doesn't get a GL context since it's not supported, it just aborts/asserts and core dumps. That's confusing several users who think our drivers are broken because it looks like a crash, not simply the GL version support not being sufficient. Apps shouldn't crash just because the GPU doesn't meet their minimum requirements.

For comparison, OBS also needs a higher version, but when it doesn't get it it shows a user-friendly dialog box telling the user that their GPU is not supported. That is what I expect Blender to do. At the very least it should print out a friendlier message to stderr and exit with a normal error, instead of outright crashing.

Comment 6 Hector Martin 2023-09-11 14:33:24 UTC
Note that this shouldn't be unique to Asahi in any way, e.g. upstream Fedora kernel/Mesa should have the same exact result on Panfrost (ARM Mali) platforms, which are also advertising OpenGL 3.1 at this time fully upstream.

Comment 7 Nicolas Chauvet (kwizart) 2023-09-14 10:40:21 UTC
@Hector
Thanks for getting in touch.

My understanding is that for testing the appropriate GL context, you have to actually create one. That's why you have a failure (not specific to blender).
Actually I was able to reproduce the error with intel using MESA_GL_VERSION_OVERRIDE=2.1 (or 3.1). But not with 3.3 that only have the EGL_BAD_MATCH and not the core dump (despite current blender claims to only support GL 4.3 at https://www.blender.org/download/requirements/).

You might need to report the issue to blender upstream (or even with epoxy that seems like the component involved).

Comment 8 Fedora Update System 2024-01-08 03:36:26 UTC
FEDORA-EPEL-2024-deb88a9bfa has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-deb88a9bfa

Comment 9 Fedora Update System 2024-01-08 03:36:27 UTC
FEDORA-2024-a97561b46e has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2024-a97561b46e

Comment 10 Fedora Update System 2024-01-09 01:30:43 UTC
FEDORA-EPEL-2024-deb88a9bfa has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-deb88a9bfa

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2024-01-09 01:39:10 UTC
FEDORA-2024-a97561b46e has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-a97561b46e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-a97561b46e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-01-17 00:36:49 UTC
FEDORA-EPEL-2024-deb88a9bfa has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2024-01-17 01:36:56 UTC
FEDORA-2024-a97561b46e has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.