Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: OpenGL 4.4 or later is required / WSL2 Ubuntu problem? #90

Closed
adevra opened this issue Sep 9, 2022 · 2 comments
Closed

Comments

@adevra
Copy link

adevra commented Sep 9, 2022

Hi,
I've been trying to build Deep3DFaceRecon in WSL2 Ubuntu 20.04
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01 Driver Version: 516.94 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+

I get this error and nothing come out of my troubleshooting efforts, I wonder if there is an issue with WSL2 Ubuntu and nvdiffrast


Transfer BFM09 to BFM_model_front......
model [FaceReconModel] was created
loading the model from ./checkpoints/ade/epoch_20.pth
0 ./datasets/examples/000002.jpg
Traceback (most recent call last):
  File "test.py", line 72, in <module>
    main(0, opt,opt.img_folder)
  File "test.py", line 62, in main
    model.test()           # run inference
  File "/home/adunix/Deep3DFaceRecon_pytorch/models/base_model.py", line 162, in test
    self.forward()
  File "/home/adunix/Deep3DFaceRecon_pytorch/models/facerecon_model.py", line 139, in forward
    self.pred_vertex, self.facemodel.face_buf, feat=self.pred_color)
  File "/home/adunix/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/adunix/Deep3DFaceRecon_pytorch/util/nvdiffrast.py", line 58, in forward
    self.glctx = dr.RasterizeGLContext(device=device)
  File "/home/adunix/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/nvdiffrast/torch/ops.py", line 221, in __init__
    self.cpp_wrapper = _get_plugin(gl=True).RasterizeGLStateWrapper(output_db, mode == 'automatic', cuda_device_idx)
RuntimeError: OpenGL 4.4 or later is required
Segmentation fault

I can run triangle.py with cuda just fine, but with --opengl its the same error.

Thanks in advance

@s-laine
Copy link
Collaborator

s-laine commented Sep 9, 2022

OpenGL/Cuda interop is unfortunately not supported in WSL2. To use the Cuda-based rasterizer in nvdiffrast instead of OpenGL, you can replace RasterizeGLContext with RasterizeCudaContext here in Deep3DFaceRecon_pytorch sources.

@adevra
Copy link
Author

adevra commented Sep 9, 2022

OpenGL/Cuda interop is unfortunately not supported in WSL2. To use the Cuda-based rasterizer in nvdiffrast instead of OpenGL, you can replace RasterizeGLContext with RasterizeCudaContext here in Deep3DFaceRecon_pytorch sources.

Works perfectly now. I think Deep3DFaceRecon has to update it like this.
Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants