Solved SDL2 LibGL error: faild to load radeonsi...

Hi,
I am having trouble executing a really simple sdl2 program I have written to test my sdl2 dev environment. It's really simple:
Code:
#include <stdio.h>                                        
#include <SDL2/SDL.h>                                             
                                                           
SDL_Window *win = NULL;                                           
Uint32 render_flags;                                              
SDL_Renderer *rend = NULL;                                 
                                                  
void                                                              
error_check_render() {                                     
        if(SDL_Init(SDL_INIT_EVERYTHING) != 0) {  
                printf("error initializing SDL: %s\n", SDL_GetError());
        }                                         
        win  = SDL_CreateWindow("Bitfroest",              
                                0,                
                                0,                         
                                1920, 1080, 0);            
        render_flags = SDL_RENDERER_ACCELERATED;                  
        rend = SDL_CreateRenderer(win, -1, render_flags);  
}
                                                   
int                                                
main() {                                           
        error_check_render();                      
        SDL_DestroyRenderer(rend);                
        SDL_DestroyWindow(win);                   
        SDL_Quit();                                       
        return 0;                                
}
Problem is that I get a error if I try to execute the binary:
Code:
libGL error: failed to authenticate magic 1
libGL error: failed to load driver: radeonsi
If I compile the same program with my Linux system it's working right. I guess it's something FreeBSD related.
Compile script:
Code:
#!/bin/sh

clang ./src/render.c -o ./main -L/usr/local/lib -I/usr/local/include -include SDL2/SDL.h -lSDL2mai
n -lSDL2

I'm using a radeon rx 480 graphic card.
That is my rc.conf:
Code:
clear_tmp_enable="YES"
hostname="magi"
keymap="de.kbd"
ifconfig_igb0="DHCP"
ifconfig_igb0_ipv6="inet6 accept_rtadv"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
#sysrc kld_list+=fusefs
#kld_list="fusefs"
nfs_client_enable="YES"
kld_list="amdgpu"
It feels like I'm missing something very obvious but I don't know what.
Any help would be nice.
Thanks.
 
Does a window manager like openbox works fine ?
Does
Code:
ldstat |grep -i radeon
shows readeonkms.ko ?

Under which window manager do you run your program ?
 
Does a window manager like openbox works fine ?
Does
Code:
ldstat |grep -i radeon
shows readeonkms.ko ?

Under which window manager do you run your program ?
I run bspwm in combination with startx.
I can open firefox and watch videos etc.
I installed openbox and it is working fine.
I'am also running FreeBSD 13.1-RELEASE-p2.
My console does not find something like "ldstat". I looked through /usr/bin, /usr/sbin, /bin, /sbin and
find / -name "ldstat" -print
does show me nothing.
Maybe you mean some other command or I need to install some package?
 
Yeah kldstat works.
No I get nothing. The whole output is not to long so will post it:
Code:
Id Refs Address                Size Name
 1  116 0xffffffff80200000  1f30590 kernel
 2    1 0xffffffff82132000   5b93a0 zfs.ko
 3    1 0xffffffff826ec000     a158 cryptodev.ko
 4    1 0xffffffff82e00000   417220 amdgpu.ko
 5    2 0xffffffff82cf8000    739e0 drm.ko
 6    3 0xffffffff82d6c000     5220 linuxkpi_gpl
 7    4 0xffffffff82d72000     62d8 dmabuf.ko
 8    1 0xffffffff82d79000     c758 ttm.ko
 9    1 0xffffffff82d86000     a0b8 amdgpu_polar
10    1 0xffffffff82d91000     6370 amdgpu_polar
11    1 0xffffffff82d98000     6370 amdgpu_polar
12    1 0xffffffff82d9f000     4370 amdgpu_polar
13    1 0xffffffff82da4000     7c98 amdgpu_polar
14    1 0xffffffff82dac000    42380 amdgpu_polar
15    1 0xffffffff83218000    42380 amdgpu_polar
16    1 0xffffffff82def000     5270 amdgpu_polar
17    1 0xffffffff82df5000     5270 amdgpu_polar
18    1 0xffffffff8325b000    5db58 amdgpu_polar
19    1 0xffffffff832b9000    2ac78 amdgpu_polar
20    1 0xffffffff832e4000    21d80 amdgpu_polar
21    1 0xffffffff82dfb000     3378 acpi_wmi.ko
22    1 0xffffffff83306000     3218 intpm.ko
23    1 0xffffffff8330a000     2180 smbus.ko
24    1 0xffffffff8330d000     2340 uhid.ko
25    1 0xffffffff83310000     3380 usbhid.ko
26    4 0xffffffff83314000     31f8 hidbus.ko
27    1 0xffffffff83318000     2240 xb360gp.ko
28    2 0xffffffff8331b000     30a8 hidmap.ko
29    1 0xffffffff8331f000     21e8 hgame.ko
30    1 0xffffffff83322000     3320 wmt.ko
31    1 0xffffffff83326000     4350 ums.ko
32    1 0xffffffff8332b000     e538 snd_uaudio.k

Besides "amdgpu" which should be the right driver for my "amd radeon rx 480" is see nothing with radeon it.
 
Sorry, but that's the wrong path here. Kernel drivers have nothing to do with the issue at hand.

The software, for some reason, fails to load the radeonsi_dri.so userspace driver, which is provided by graphics/mesa-dri. Make sure it is installed, and make sure it's up to date (matching the libGL your SDL installation is using).
 
Sorry, but that's the wrong path here. Kernel drivers have nothing to do with the issue at hand.

The software, for some reason, fails to load the radeonsi_dri.so userspace driver, which is provided by graphics/mesa-dri. Make sure it is installed, and make sure it's up to date (matching the libGL your SDL installation is using).
Upgrading all packages was the solution. The errors disappeared instantly after that. Thank you.
 
Back
Top