Skip to content

RuntimeError: OpenGL 4.4 or later is required / WSL2 Ubuntu 20.04 #107

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

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

RuntimeError: OpenGL 4.4 or later is required / WSL2 Ubuntu 20.04 #107

adevra opened this issue Sep 9, 2022 · 4 comments

Comments

@adevra
Copy link

adevra commented Sep 9, 2022

I am able to build and run in windows 11 without problems,
Now trying to build in WSL2 Ubuntu20.04 but having this error,

I did nvdiffrasts basic triangle.py test to see if it gives any errors,
with --cuda flag, it outputs tri.png
with --opengl it gives error and thats the same error I get after running demo


(deep3d) adunix@DESKTOP-JH0UJT1:~/Deep3DFaceRecon_pytorch/nvdiffrast/samples/torch$ python triangle.py --cuda
Saving to 'tri.png'.
(deep3d) adunix@DESKTOP-JH0UJT1:~/Deep3DFaceRecon_pytorch/nvdiffrast/samples/torch$ python triangle.py --opengl
Traceback (most recent call last):
  File "triangle.py", line 21, in <module>
    glctx = dr.RasterizeGLContext()
  File "/home/adunix/anaconda3/envs/deep3d/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
(deep3d) adunix@DESKTOP-JH0UJT1:~/Deep3DFaceRecon_pytorch/nvdiffrast/samples/torch$

any ideas?
thanks in advance

@adevra
Copy link
Author

adevra commented Sep 9, 2022

(deep3d) adunix@DESKTOP-JH0UJT1:~/Deep3DFaceRecon_pytorch$ python test.py --name=ade --epoch=20 --img_folder=./datasets/examples
/home/adunix/anaconda3/envs/deep3d/lib/python3.6/site-packages/kornia/augmentation/augmentation.py:1875: DeprecationWarning: GaussianBlur is no longer maintained and will be removed from the future versions. Please use RandomGaussianBlur instead.
  category=DeprecationWarning,
/home/adunix/anaconda3/envs/deep3d/lib/python3.6/site-packages/torch/utils/cpp_extension.py:4: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
----------------- Options ---------------
                add_image: True
               bfm_folder: BFM
                bfm_model: BFM_model_front.mat
                 camera_d: 10.0
                   center: 112.0
          checkpoints_dir: ./checkpoints
             dataset_mode: None
                 ddp_port: 12355
        display_per_batch: True
                    epoch: 20                                   [default: latest]
          eval_batch_nums: inf
                    focal: 1015.0
                  gpu_ids: 0
               img_folder: ./datasets/examples                  [default: examples]
                init_path: checkpoints/init_model/resnet50-0676ba61.pth
                  isTrain: False                                [default: None]
                    model: facerecon
                     name: ade                                  [default: face_recon]
                net_recon: resnet50
                    phase: test
                   suffix:
                  use_ddp: False                                [default: True]
              use_last_fc: False
                  verbose: False
           vis_batch_nums: 1
               world_size: 1
                    z_far: 15.0
                   z_near: 5.0
----------------- End -------------------
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/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/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

@adevra
Copy link
Author

adevra commented Sep 9, 2022

I guess this one solves it, recloning now
#108 (comment)

@adevra
Copy link
Author

adevra commented Sep 9, 2022

still the same

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

@adevra
Copy link
Author

adevra commented Sep 9, 2022

The developer of nvdiffrast answered and solved this issue.
NVlabs/nvdiffrast#90 (comment)

@adevra adevra closed this as completed Sep 9, 2022
@adevra adevra changed the title RuntimeError: OpenGL 4.4 or later is required RuntimeError: OpenGL 4.4 or later is required / WSL2 Ubuntu 20.04 Sep 9, 2022
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

1 participant