Healthcare-Robotics / bodies-at-rest

Code + Data for CVPR 2020 oral paper "Bodies at Rest: 3D Human Pose and Shape Estimation from a Pressure Image using Synthetic Data."
Other
62 stars 8 forks source link

pyglet.gl.ContextException: Could not create GL context #15

Closed YoloZyk closed 1 month ago

YoloZyk commented 3 months ago

Hi, I am trying to visualize the generated data using viz_synth_cvpr_release.py, but I am encountering the following error

Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/opt/conda/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/lib/python3.8/site-packages/pyrender/viewer.py", line 1016, in _init_and_start_app
    super(Viewer, self).__init__(config=conf, resizable=True,
  File "/opt/conda/lib/python3.8/site-packages/pyglet/window/xlib/__init__.py", line 138, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/pyglet/window/__init__.py", line 538, in __init__
    context = config.create_context(gl.current_context)
  File "/opt/conda/lib/python3.8/site-packages/pyglet/gl/xlib.py", line 105, in create_context
    return XlibContext(self, share)
  File "/opt/conda/lib/python3.8/site-packages/pyglet/gl/xlib.py", line 127, in __init__
    raise gl.ContextException('Could not create GL context')
pyglet.gl.ContextException: Could not create GL context

The platform information I use is as follows

Platform
------------------------------------------------------------------------------
platform:  Linux-5.15.0-91-generic-x86_64-with-glibc2.17
release:   5.15.0-91-generic
machine:   x86_64

Python
------------------------------------------------------------------------------
implementation: CPython
sys.version: 3.8.12 (default, Oct 12 2021, 13:49:34)
[GCC 7.5.0]
sys.maxint: 9223372036854775807
os.getcwd(): /workspace/zyk/bodies-at-rest/PressurePose

pyglet
------------------------------------------------------------------------------
pyglet.version: 2.0.14
pyglet.compat_platform: linux
pyglet.__file__: /opt/conda/lib/python3.8/site-packages/pyglet/__init__.py
pyglet.options['audio'] = ('xaudio2', 'directsound', 'openal', 'pulse', 'silent')
pyglet.options['debug_font'] = False
pyglet.options['debug_gl'] = True
pyglet.options['debug_gl_trace'] = False
pyglet.options['debug_gl_trace_args'] = False
pyglet.options['debug_gl_shaders'] = False
pyglet.options['debug_graphics_batch'] = False
pyglet.options['debug_lib'] = False
pyglet.options['debug_media'] = False
pyglet.options['debug_texture'] = False
pyglet.options['debug_trace'] = False
pyglet.options['debug_trace_args'] = False
pyglet.options['debug_trace_depth'] = 1
pyglet.options['debug_trace_flush'] = True
pyglet.options['debug_win32'] = False
pyglet.options['debug_input'] = False
pyglet.options['debug_x11'] = False
pyglet.options['shadow_window'] = True
pyglet.options['vsync'] = None
pyglet.options['xsync'] = True
pyglet.options['xlib_fullscreen_override_redirect'] = False
pyglet.options['search_local_libs'] = True
pyglet.options['win32_gdi_font'] = False
pyglet.options['headless'] = False
pyglet.options['headless_device'] = 0
pyglet.options['win32_disable_shaping'] = False
pyglet.options['dw_legacy_naming'] = False
pyglet.options['win32_disable_xinput'] = False
pyglet.options['com_mta'] = False
pyglet.options['osx_alt_loop'] = False

For clarity, I've also included the cuda versions and dependencies I use below

Thu Mar 14 21:30:07 2024
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.141.03   Driver Version: 470.141.03   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:81:00.0 Off |                  N/A |
| 42%   31C    P8    22W / 350W |     10MiB / 24268MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:82:00.0 Off |                  N/A |
| 41%   30C    P8    26W / 350W |     10MiB / 24268MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce ...  Off  | 00000000:C1:00.0 Off |                  N/A |
| 39%   30C    P8    27W / 350W |     10MiB / 24268MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce ...  Off  | 00000000:C2:00.0 Off |                  N/A |
| 43%   31C    P8    23W / 350W |     10MiB / 24268MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

python 3.8.12
Package                Version
---------------------- ---------
backcall               0.2.0
beautifulsoup4         4.10.0
brotlipy               0.7.0
certifi                2021.10.8
cffi                   1.15.0
chardet                4.0.0
charset-normalizer     2.0.4
chumpy                 0.70
click                  8.1.3
conda                  4.11.0
conda-build            3.21.7
conda-content-trust    0+unknown
conda-package-handling 1.7.3
contourpy              1.1.1
cryptography           36.0.0
cycler                 0.12.1
decorator              5.1.1
dnspython              2.2.1
docker-pycreds         0.4.0
filelock               3.4.2
fonttools              4.49.0
freetype-py            2.4.0
future                 1.0.0
gitdb                  4.0.10
GitPython              3.1.29
glob2                  0.7
h5py                   3.7.0
idna                   3.3
imageio                2.34.0
importlib_resources    6.3.0
ipython                7.31.1
jedi                   0.18.1
Jinja2                 2.11.3
joblib                 1.3.2
kiwisolver             1.4.5
libarchive-c           2.9
MarkupSafe             2.0.1
matplotlib             3.7.5
matplotlib-inline      0.1.2
mkl-fft                1.3.1
mkl-random             1.2.2
mkl-service            2.4.0
networkx               3.1
numpy                  1.21.2
opencv-python          4.6.0.66
packaging              24.0
pandas                 1.5.2
parso                  0.8.3
pathtools              0.1.2
pexpect                4.8.0
pickleshare            0.7.5
Pillow                 9.0.1
pip                    21.2.4
pkginfo                1.8.2
progressbar2           4.2.0
promise                2.3
prompt-toolkit         3.0.20
protobuf               4.21.12
psutil                 5.8.0
ptyprocess             0.7.0
pycosat                0.6.3
pycparser              2.21
pyglet                 2.0.14
Pygments               2.11.2
PyOpenGL               3.1.0
pyOpenSSL              21.0.0
pyparsing              3.1.2
pyrender               0.1.45
PySocks                1.7.1
python-dateutil        2.8.2
python-etcd            0.4.5
python-utils           3.4.5
pytz                   2021.3
PyYAML                 6.0
requests               2.27.1
ruamel-yaml-conda      0.15.100
scikit-learn           1.3.2
scipy                  1.9.3
sentry-sdk             1.12.0
setproctitle           1.3.2
setuptools             58.0.4
shortuuid              1.0.11
six                    1.16.0
smmap                  5.0.0
soupsieve              2.3.1
threadpoolctl          3.3.0
torch                  1.11.0
torchelastic           0.2.2
torchtext              0.12.0
torchvision            0.12.0
tqdm                   4.62.3
traitlets              5.1.1
trimesh                4.2.0
typing-extensions      3.10.0.2
urllib3                1.26.13
wandb                  0.13.7
wcwidth                0.2.5
wheel                  0.37.1
zipp                   3.18.0

This may not be an issue with Python 2/3, as I can render normally on my local PC (windows, Python 3.9.18)

So how can I solve this problem, thanks for your help!

henryclever commented 1 month ago

Hi, last time I got this working I first went and made sure all the pip packages were versions from the time that this repo was published (early 2020). I'm not sure about your cuda headers .... you may need to install old ones to make it work :/

Python 3.8 seems too new, as a start, but maybe the problem is somewhere else? I recommend just do everything in a virtualenv so you can easily switch to new versions (i suspect you are already doing this).

Sorry it's such a delayed response - i hope you were able to find workarounds and make progress.

-H

YoloZyk commented 1 month ago

Thank you for your patient response. It seems that the best approach is to replicate these tasks within the environment provided in the code repository. However, these questions are no longer of importance to me. I greatly appreciate your valuable time and assistance. Thank you once again.

Best regards, Zhang