matusnovak / rpi-opengl-without-x

Raspberry Pi OpenGL ES 2 without an X server (using EGL)
The Unlicense
178 stars 32 forks source link

raspbian eGL issue #2

Closed ghost closed 5 years ago

ghost commented 5 years ago

Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

sudo apt-get install mesa-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mesa-utils is already the newest version (8.3.0-3).
mesa-utils set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.

pi@raspberrypi:~/rpi-opengl-without-x $ 

pi@raspberrypi:~/rpi-opengl-without-x $ ./triangle 
libEGL warning: DRI3: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
Failed to get EGL version! Error: 
matusnovak commented 5 years ago

What version of Raspberry Pi do you have? I see armv7l so I assume Raspberry Pi 2.

Are you using Raspbian? If so, is this a fresh installation? I am asking in case you have installed mesa-utils before, because, as far as I know, the default ones that are installed through apt-get are not compatible at all.

But, at least in Raspbian OS, there is libEGL.so and libbrcmEGL.so. Could you try linking the later?(Running dpkg -S libbrcmEGL should show you the exact location).

Try the following:

pi@rpi3-1:~ $ gcc -c triangle.c -o triangle.o -I/opt/vc/include
pi@rpi3-1:~ $ gcc -o triangle triangle.o -lbrcmEGL -lbrcmGLESv2 -L/opt/vc/lib
pi@rpi3-1:~ $ ./triangle
Initialized EGL version: 1.4
GL Viewport size: 800x600
pi@homelab-rpi3-1:~ $
ghost commented 5 years ago

Hi, will give more info Sunday. Appreciate and thank you

Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux ` lrwxrwxrwx 1 root root 15 Aug 4 2017 ./lib/arm-linux-gnueabihf/libEGL.so -> libEGL.so.1.0.0 lrwxrwxrwx 1 root root 18 Aug 4 2017 ./lib/arm-linux-gnueabihf/libGLESv2.so -> libGLESv2.so.2.0.0 lrwxrwxrwx 1 root root 14 Aug 4 2017 ./lib/arm-linux-gnueabihf/libGL.so -> libGL.so.1.2.0 lrwxrwxrwx 1 root root 15 Sep 19 2015 ./lib/arm-linux-gnueabihf/libGLU.so -> libGLU.so.1.3.1 lrwxrwxrwx 1 root root 21 Jan 30 2019 ./lib/arm-linux-gnueabihf/libQt5OpenGL.so -> libQt5OpenGL.so.5.7.1

pi@raspberrypi:/usr $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

fbset

mode "720x576" geometry 720 576 720 576 32 timings 0 0 0 0 0 0 0 accel true rgba 8/16,8/8,8/0,0/0 endmode

`

matusnovak commented 5 years ago

@comarius

The /lib/arm-linux-gnueabihf/libEGL.so and so on, are incorrect. They are installed via mesa-* packages, which are incompatible. You need the EGL and GLESv2 provided by Raspbian OS. They should be located in /opt/vc/lib and labelled libbrcm*.so.

There is some info about it here and this issue mentions that the libEGL has been renamed to libbrcmEGL.

ghost commented 5 years ago

Thank you. Will do. I am sure will work.