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 ))
AssertionError:
执行下面命令
apt-get update
apt-get upgrade