Ubuntu配置pyrender离屏渲染

Ubuntu下使用pyrender的离屏渲染时会出现如下错误:

OpenGL.error.GLError: GLError(err = 12289,baseOperation = eglMakeCurrent ....

解决办法:

apt update
apt-get install llvm-6.0
apt-get install libsm6 libxrender1 libfontconfig1 freeglut3-dev
apt --fix-broken install

wget https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb
dpkg -i ./mesa_18.3.3-0.deb || true
apt install -f
git clone https://github.com/mmatl/pyopengl.git
pip install ./pyopengl

import pyrender之前设置

os.environ["PYOPENGL_PLATFORM"] = "osmesa"

参考:https://github.com/Arthur151/CenterHMR/blob/master/src/bugs.md


如果出现错误

42         assert(OSMesaMakeCurrent(
     43             self._context, self._buffer, gl.GL_UNSIGNED_BYTE,
---> 44             self.viewport_width, self.viewport_height
     45         ))
     46 

AssertionError: 

执行下面命令

apt-get update
apt-get upgrade
posted @ 2020-09-08 19:20  VVingerfly  阅读(6531)  评论(6编辑  收藏  举报