File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525import collections
2626import os
2727
28+ from absl import logging
2829from dm_control ._render import constants
2930
3031BACKEND = os .environ .get (constants .MUJOCO_GL )
@@ -61,18 +62,25 @@ def _import_osmesa():
6162 raise RuntimeError (
6263 'Environment variable {} must be one of {!r}: got {!r}.'
6364 .format (constants .MUJOCO_GL , _ALL_RENDERERS .keys (), BACKEND ))
65+ logging .info ('MUJOCO_GL=%s, attempting to import specified OpenGL backend.' ,
66+ BACKEND )
6467 Renderer = import_func () # pylint: disable=invalid-name
6568else :
69+ logging .info ('MUJOCO_GL is not set, so an OpenGL backend will be chosen '
70+ 'automatically.' )
6671 # Otherwise try importing them in descending order of priority until
6772 # successful.
6873 for name , import_func in _ALL_RENDERERS .items ():
6974 try :
7075 Renderer = import_func ()
7176 BACKEND = name
77+ logging .info ('Successfully imported OpenGL backend: %s' , name )
7278 break
7379 except ImportError :
74- pass
80+ logging . info ( 'Failed to import OpenGL backend: %s' , name )
7581 if BACKEND is None :
82+ logging .info ('No OpenGL backend could be imported. Attempting to create a '
83+ 'rendering context will result in a RuntimeError.' )
7684
7785 def Renderer (* args , ** kwargs ): # pylint: disable=function-redefined,invalid-name
7886 del args , kwargs
You can’t perform that action at this time.
0 commit comments