Also, the current version of nvdiffrast includes a Cuda-based rasterizer that doesn't require OpenGL. You may want to consider switching to that by default, as setting up OpenGL can be tricky on some platforms.
I recommend to replace the RasterizeGLContext() function in core/NvDiffRastRenderer.py line 25 to RasterizeCudaContext().
Since the nvdiffast developr mentioned in https://github.com/sicxu/Deep3DFaceRecon_pytorch/issues/108
I recommend to replace the RasterizeGLContext() function in core/NvDiffRastRenderer.py line 25 to RasterizeCudaContext().
It should be fine since I can run the code after the replacement, and if I don't replace it, I came up with the same problem in https://github.com/sicxu/Deep3DFaceRecon_pytorch/issues/2