use `if('opengl' in sys.capabilities)` instead