Could not initialize egl ошибка

Found 3 GPUs for rendering. Using device 1.
libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device.
Could not initialize EGL
Traceback (most recent call last):
  File "meld/scripts/run_meld.py", line 1023, in <module>
    app.run(main)
......
File "/home/CDJ/testRL/meld/meld/environments/gym_wrappers.py", line 143, in _reset
    return self._modify_observation(observation)
  File "/home/CDJ/testRL/meld/meld/environments/gym_wrappers.py", line 125, in _modify_observation
    image = self._env.sim.render(**self._render_kwargs)[::-1, :, :]
  File "mujoco_py/mjsim.pyx", line 156, in mujoco_py.cymj.MjSim.render
  File "mujoco_py/mjsim.pyx", line 158, in mujoco_py.cymj.MjSim.render
  File "mujoco_py/mjrendercontext.pyx", line 45, in mujoco_py.cymj.MjRenderContext.__init__
  File "mujoco_py/mjrendercontext.pyx", line 113, in mujoco_py.cymj.MjRenderContext._setup_opengl_context
  File "mujoco_py/opengl_context.pyx", line 130, in mujoco_py.cymj.OffscreenOpenGLContext.__init__
RuntimeError: Failed to initialize OpenGL

image
The images is the code from mujoco_py/mjrendercontext.pyx.

I try to run the following sample script on Windows 7 with OpenGL 1.1:

from kivy.app import App
from kivy.uix.label import Label

class MyApp(App):

    def build(self):
        return Label(text='Hello world')


if __name__ == '__main__':
    MyApp().run()

and i receive the following error

[INFO ] [Logger ] Record log in C:UsersAdmin.kivylogskivy_20-03-09_20.txt 
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.2.0 
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.2.0 
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.2.0 
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.2.0 
[INFO ] [Kivy ] v1.11.1 
[INFO ] [Kivy ] Installed at "F:Data_analyticsvenvlibsite-packageskivy_init_.py" 
[INFO ] [Python ] v3.6.0 (default, Jan 23 2017, 17:35:20) [MSC v.1900 32 bit (Intel)] 
[INFO ] [Python ] Interpreter at "F:Data_analyticsvenvScriptspython.exe" 
[INFO ] [Factory ] 184 symbols loaded 
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored) [INFO ] [Text ] Provider: sdl2 
[INFO ] [Window ] Provider: sdl2 
[INFO ] [Window ] Activate GLES2/ANGLE context 
[CRITICAL] [Window ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes sdl2 - RuntimeError: b'Could not initialize EGL' File "F:Data_analyticsvenvlibsite-packageskivycore_init_.py", line 71, in core_select_lib cls = cls() File "F:Data_analyticsvenvlibsite-packageskivycorewindowwindow_sdl2.py", line 152, in init super(WindowSDL, self).init() File "F:Data_analyticsvenvlibsite-packageskivycorewindow_init_.py", line 981, in init self.create_window() File "F:Data_analyticsvenvlibsite-packageskivycorewindowwindow_sdl2.py", line 290, in create_window self.get_gl_backend_name()) File "kivycorewindow_window_sdl2.pyx", line 224, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window File "kivycorewindow_window_sdl2.pyx", line 74, in kivy.core.window._window_sdl2._WindowSDL2Storage.die

[CRITICAL] [App ] Unable to get a Window, abort.

I have used user environment variable KIVY_GL_BACKEND with value angel_sdl2.

Any idea what should i correct and get a successful result?

If this has boiled down to an ‘ldconfig’ issue you may be having an «LD_LIBRARY_PATH problem» — ‘ldd’ respects that so results can differ depending on it. That is, without it set correctly ‘ldd’ may erroneously pick a system lib instead of yours.

In my case, I rarely produce an «official» package (.deb/.rpm etc) because what I used to be asked to build used to be «updates» to existing packages and thus do not want to use ‘ldconfig’ either. Instead..

Code: Select all

foo@sdu /kvm $ cat /usr/local/sd/bin/sd-qt
#!/bin/bash

PATH=/usr/local/QT/5.12.5/bin:$PATH 
LD_LIBRARY_PATH=/usr/local/QT/5.12.5/lib64:/usr/local/QT/5.12.5/lib32:/usr/local/QT/5.12.5/lib:/usr/local/QT/5.12.5/lib/qtcreator 
LLVM_INSTALL_DIR=/usr/local/QT/5.12.5 
QTC_ENABLE_LIBTOOLING=1 
QTDIR=/usr/local/QT/5.12.5 
MANPATH=/usr/local/QT/5.12.5/share/man 
INFOPATH=/usr/local/QT/5.12.5/share/info 
"$@"

I’m not sure all the above is required (the Qt docs can be confusing, especially across versions).

In essence, whenever I want to invoke a 5.12.5 app I use «sd-qt [appname]» and the correct things are found without impacting the system in any way. Obviously you’d replace «$@» with your app name. You can see something similar happening in ‘qtcreator.sh’ if you’ve ever built it. You’ll be able to call ‘qtcreator’ directly if you’ve got the above correct.

Note the above is from my PC. It’s the same on an rpi however. I’m using the PC example because it does use a symlink but only in one place: the installation directory..

Code: Select all

foo@sdu /kvm $ lc /usr/local/QT/
total 8
lrwxrwxrwx  1 root root    5 Feb 15 05:14 5.12.5 -> 5125r
drwxr-xr-x  2 foo  foo  4096 Mar 22 08:49 5125d
drwxr-xr-x 24 root root 4096 Feb 14 21:48 5125r

5125r is a normal (release) build whereas 5125d is same but with debug. Both are built and install to /usr/local/QT/5.12.5/ and all I do is rename the target folder then point the symlink to one of them. I do it this way because with a complex build like Qt you can never be certain there isn’t a hard coded path in there — plus I build a load of other stuff before Qt.

You wouldn’t need that lengthy LD_LIBRARY_PATH above just for the pi. It’s just that particular search arrangement works for the PC and an rpi and saves my build script having to specifically having to check which target it is building for (and should also work if ever a 64bit rasbian comes along).

I got the following error when set

export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_INTEGRATION=none

the configure output is:
QPA backends:
DirectFB …………. no
EGLFS ……………. yes
EGLFS i.MX6 …….. no
EGLFS i.MX6 Wayland. no
EGLFS EGLDevice …. no
EGLFS GBM ………. yes
EGLFS Mali ……… no
EGLFS Raspberry Pi . no
EGLFS X11 ………. no
LinuxFB ………….. yes

The platform is Beagle Bone Black.
with sgx ddk installed.

^C(devenv) root@beaglebone:~# lsmod | grep example
bc_example 8635 0
pvrsrvkm 433627 1 bc_example

loaded library «/usr/local/qt5/plugins/platforms/libqeglfs.so»
QFactoryLoader::QFactoryLoader() checking directory path «/usr/local/qt5/plugins/platforms/egldeviceintegrations» …
QFactoryLoader::QFactoryLoader() checking directory path «/usr/local/qt5/plugins/egldeviceintegrations» …
QFactoryLoader::QFactoryLoader() looking at «/usr/local/qt5/plugins/egldeviceintegrations/libqeglfs-kms-integration.so»
Found metadata in lib /usr/local/qt5/plugins/egldeviceintegrations/libqeglfs-kms-integration.so, metadata=
{
«IID»: «org.qt-project.qt.qpa.egl.QEGLDeviceIntegrationFactoryInterface.5.5»,
«MetaData»: {
«Keys»: [
«eglfs_kms»
]
},
«className»: «QEglFSKmsGbmIntegrationPlugin»,
«debug»: false,
«version»: 329472
}

Got keys from plugin meta data («eglfs_kms»)
QFactoryLoader::QFactoryLoader() checking directory path «/root/egldeviceintegrations» …
libEGL warning: DRI3: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
Could not initialize egl display
Aborted

Please Help to advise how to proceed.

Thanks,

I have a CentOS host which should be used to develop Qt applications (version 5.12.8) for a Raspberry Pi. I use the following Raspberry Pi setup:

$ cat /proc/cpuinfo
...
model name      : ARMv7 Processor rev 4 (v7l)
...

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
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"

The Raspberry Pi is prepared with the following script:

sudo apt-get update
sudo apt-get -y build-dep qt5-qmake
sudo apt-get -y build-dep libqt5gui5
sudo apt-get -y build-dep libqt5webengine-data
sudo apt-get -y build-dep libqt5webkit5
sudo apt-get -y install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0 gdbserver

sudo mkdir /usr/local/RaspberryQt
sudo chown -R pi:pi /usr/local/RaspberryQt

sudo mkdir -p /root/.ssh
sudo chmod 700 /root/.ssh
sudo mkdir -p /home/pi/.ssh
sudo chmod 700 /home/pi/.ssh

And for the host I use this script:

DEVICE=linux-rasp-pi3-g++
IP=...
CORES=4
DIRECTORY=/opt/RaspberryQt
COMPILER_PATH=/opt/Toolchain/RaspberryPi

Red="33[0;31m"
Green="33[0;32m"
Reset="33[0m"
Yellow="33[0;33m"
Cyan="33[0;36m"

echo -e ${Yellow}"Install packages..."${Reset}
sudo apt-get update
sudo apt-get -y install gcc git bison python gperf pkg-config gdb-multiarch qt5-default

echo -e ${Yellow}"Create directories..."${Reset}
sudo mkdir -p ${DIRECTORY}/log ${DIRECTORY}/build
sudo mkdir -p ${COMPILER_PATH}/sysroot ${COMPILER_PATH}/sysroot/usr ${COMPILER_PATH}/sysroot/opt

cd ${DIRECTORY}
sudo chown -R 1000:1000 ${DIRECTORY}
sudo chown -R 1000:1000 ${COMPILER_PATH}

echo -e ${Yellow}"Generate SSH keys..."${Reset}
ssh-keygen -t rsa -C root@${IP} -P "" -f ~/.ssh/rpi_root_id_rsa
ssh-keygen -t rsa -C pi@${IP} -P "" -f ~/.ssh/rpi_pi_id_rsa
cat ~/.ssh/rpi_root_id_rsa.pub | ssh root@${IP} 'cat >> .ssh/authorized_keys && chmod 640 .ssh/authorized_keys'
cat ~/.ssh/rpi_pi_id_rsa.pub | ssh pi@${IP} 'cat >> .ssh/authorized_keys && chmod 640 .ssh/authorized_keys'

echo -e ${Yellow}"Download toolchain..."${Reset}
cd ${COMPILER_PATH}
git clone https://github.com/raspberrypi/tools
cd ${DIRECTORY}

echo -e ${Yellow}"Download Qt..."${Reset}
wget https://download.qt.io/archive/qt/5.12/5.12.8/single/qt-everywhere-src-5.12.8.tar.xz

echo -e ${Yellow}"Download Python script..."${Reset}
wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
sudo chmod +x sysroot-relativelinks.py

tar xf qt-everywhere-src-5.12.8.tar.xz
cp -R qt-everywhere-src-5.12.8/qtbase/mkspecs/linux-arm-gnueabi-g++ qt-everywhere-src-5.12.8/qtbase/mkspecs/linux-arm-gnueabihf-g++
sed -i -e 's/arm-linux-gnueabi-/arm-linux-gnueabihf-/g' qt-everywhere-src-5.12.8/qtbase/mkspecs/linux-arm-gnueabihf-g++/qmake.conf

cd ${COMPILER_PATH}
echo -e ${Yellow}"Download /lib..."${Reset}
rsync -avz root@${IP}:/lib sysroot | tee ${DIRECTORY}/log/copy_lib.log
echo -e ${Yellow}"Download /usr/include..."${Reset}
rsync -avz root@${IP}:/usr/include sysroot/usr | tee ${DIRECTORY}/log/copy_usr_include.log
echo -e ${Yellow}"Download /usr/lib..."${Reset}
rsync -avz root@${IP}:/usr/lib sysroot/usr | tee ${DIRECTORY}/log/copy_usr_lib.log
echo -e ${Yellow}"Download /opt/vc..."${Reset}
rsync -avz root@${IP}:/opt/vc sysroot/opt | tee ${DIRECTORY}/log/copy_opt_vc.log

echo -e ${Yellow}"Change symlinks..."${Reset}
ln -s sysroot/opt/vc/lib/libEGL.so sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0
ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
ln -s sysroot/opt/vc/lib/libEGL.so sysroot/opt/vc/lib/libEGL.so.1
ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/opt/vc/lib/libGLESv2.so.2
${DIRECTORY}/sysroot-relativelinks.py sysroot

echo -e ${Yellow}"Configure Qt..."${Reset}
cd ${DIRECTORY}/build
../qt-everywhere-src-5.12.8/configure -opengl es2 -device ${DEVICE} -device-option CROSS_COMPILE=${COMPILER_PATH}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ${COMPILER_PATH}/sysroot -prefix /usr/local/RaspberryQt -opensource -confirm-license -no-gbm -skip qtscript -nomake tests -nomake examples -make libs -pkg-config -no-use-gold-linker -v | tee ${DIRECTORY}/log/config.log

echo -e ${Yellow}"Build Qt..."${Reset}
make -j${CORES} | tee ${DIRECTORY}/log/make.log
make install | tee ${DIRECTORY}/log/install.log

echo -e ${Yellow}"Clean..."${Reset}
sudo rm -r ${DIRECTORY}/build
sudo rm -r ${DIRECTORY}/sysroot-relativelinks.py
sudo rm -r ${DIRECTORY}/qt-everywhere-src-5.12.8
sudo rm ${DIRECTORY}/qt-everywhere-src-5.12.8.tar.xz

echo -e ${Yellow}"Upload to Raspberry Pi..."${Reset}
cd ${DIRECTORY}
rsync -avz ${COMPILER_PATH}/sysroot/usr/local/RaspberryQt pi@${IP}:/usr/local | tee ${DIRECTORY}/log/copy_RaspberryQt.log

The build process has finished successfully and I can create a new kit in the Qt Creator to compile the code for the Raspberry Pi.

enter image description here

Now I create a new Qt project with this kit and compile it. The compilation finished successfully too, but I got the following error in the Qt Creator when I want to run the application over SSH:

Could not initialize egl display

But I can copy the application via SCP on the Raspberry Pi to run it locally.

So what is that error and how can I fix it to run the application from my CentOS host?

  • Could not find or load main class java ошибка при компиляции
  • Could not find or load main class java ошибка при запуске
  • Could not find dayz executable ошибка что делать
  • Could not find altserver как исправить ошибку
  • Could not find a part of the path ошибка