NVIDIAGameWorks / kaolin-wisp

NVIDIA Kaolin Wisp is a PyTorch library powered by NVIDIA Kaolin Core to work with neural fields (including NeRFs, NGLOD, instant-ngp and VQAD).
Other
1.46k stars 132 forks source link

pycuda make default context error #60

Closed Hippogriff closed 2 years ago

Hippogriff commented 2 years ago

I am trying to install the library. I have the following configurations: Ubuntu 22.04.1 LTS Nvidia 3090

When I run the script for interactive rendering, I get the following error:

        [i] Using PYGLFW_IMGUI (GL 2.1)
        Traceback (most recent call last):
          File "app/main_interactive.py", line 12, in <module>
            setup_cuda_context()     # Must be called before any torch operations take place
          File "/kaolin-wisp/app/cuda_guard.py", line 34, in setup_cuda_context
            import pycuda.gl.autoinit
          File "kaolin-wisp/pycuda/pycuda/gl/autoinit.py", line 10, in <module>
            context = make_default_context(lambda dev: cudagl.make_context(dev))
          File "kaolin-wisp/pycuda/pycuda/tools.py", line 226, in make_default_context
            raise RuntimeError(
        RuntimeError: make_default_context() wasn't able to create a context on any of the 1 detected devices
haganelego commented 2 years ago

I solved this error by adding the following option when run interactive rendering. __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia

Hippogriff commented 2 years ago

Thanx @haganelego. It solved my problem. Can you please explain how setting these variables help in retaining the gl context?

fkay1 commented 1 year ago

I get this error on Windows 10. Correct me if I'm wrong but I think __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia is not possible to do in windows. I have one AMD and one NVIDIA graphics card installed, maybe thats a problem? the non interactive version seems to work though.