rgl-epfl / differentiable-sdf-rendering

Source code for "Differentiable Signed Distance Function Rendering" (Siggraph 2022)
BSD 3-Clause "New" or "Revised" License
861 stars 53 forks source link

AttributeError: jit_init_thread_state(): the CUDA backend hasn't been initialized. Make sure to call jit_init(JitBackend::CUDA) to properly initialize this backend. #21

Closed HzfFrank closed 1 year ago

HzfFrank commented 1 year ago

Excuse me, when I run python optimize.py dragon --optconfig no-tex-12, I met such error:

Traceback (most recent call last):
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/__init__.py", line 107, in __getattribute__
    _import('mitsuba.mitsuba_' + variant + '_ext'),
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1166, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: jit_init_thread_state(): the CUDA backend hasn't been initialized. Make sure to call jit_init(JitBackend::CUDA) to properly initialize this backend.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "optimize.py", line 108, in <module>
    main(sys.argv[1:])
  File "optimize.py", line 78, in main
    mi.set_variant('llvm_ad_rgb' if use_llvm else 'cuda_ad_rgb')
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/__init__.py", line 317, in set_variant
    _import('mitsuba.ad.integrators')
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/python/ad/__init__.py", line 1, in <module>
    from .integrators import *
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/python/ad/integrators/__init__.py", line 25, in <module>
    importlib.import_module('mitsuba.ad.integrators.' + name)
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/python/ad/integrators/prb_basic.py", line 6, in <module>
    from .common import RBIntegrator
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/python/ad/integrators/common.py", line 8, in <module>
    class ADIntegrator(mi.CppADIntegrator):
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/__init__.py", line 253, in __getattribute__
    result = module.__getattribute__(key)
  File "/home/username/anaconda3/envs/diff-sdf/lib/python3.8/site-packages/mitsuba/__init__.py", line 115, in __getattribute__
    raise AttributeError(e)
AttributeError: jit_init_thread_state(): the CUDA backend hasn't been initialized. Make sure to call jit_init(JitBackend::CUDA) to properly initialize this backend.

My cuda version is 11.7, Driver Version is 531.41 Is this error related to my cuda version? I'll appreciate it lot if someone can help with it.

dvicini commented 1 year ago

Closing this as the issue was resolved in the drjit issue