question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NameError: name '_C' is not defined

See original GitHub issue

Describe the bug A clear and concise description of what the bug is. I run following command:

docker run --gpus '"device=1"' -v /home/fakhriddin/patata/PersonalFakhriddin/nerf/split_allview_new:/workspace/ --rm -it dromni/nerfstudio:0.1.10 ns-train instant-ngp --data /data/nerfstudio/poster

And then it shows this error

Traceback (most recent call last):
  File "/home/user/.local/bin/ns-train", line 5, in <module>
    from scripts.train import entrypoint
  File "/home/user/nerfstudio/scripts/train.py", line 50, in <module>
    from nerfstudio.configs.method_configs import AnnotatedBaseConfigUnion
  File "/home/user/nerfstudio/nerfstudio/configs/method_configs.py", line 39, in <module>
    from nerfstudio.field_components.temporal_distortions import TemporalDistortionKind
  File "/home/user/nerfstudio/nerfstudio/field_components/__init__.py", line 17, in <module>
    from .encodings import Encoding, ScalingAndOffset
  File "/home/user/nerfstudio/nerfstudio/field_components/encodings.py", line 34, in <module>
    import tinycudann as tcnn
  File "/home/user/.local/lib/python3.8/site-packages/tinycudann/__init__.py", line 9, in <module>
    from tinycudann.modules import free_temporary_memory, NetworkWithInputEncoding, Network, Encoding
  File "/home/user/.local/lib/python3.8/site-packages/tinycudann/modules.py", line 33, in <module>
    if _C is None:
NameError: name '_C' is not defined

How to solve this issue? I pulled docker image with versions 0.1.13 and 0.1.10. I also tried to build Docker image but the same error Other parameters:

NVIDIA-SMI 520.61.05    Driver Version: 520.61.05    CUDA Version: 11.8 
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
KtechBcommented, Dec 14, 2022

I had this issue when I use Docker , and tried pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch --force-reinstall but not solved. So, I tried use tiny-cuda-nn of older version. Then it worked well.

pip install git+https://github.com/NVlabs/tiny-cuda-nn.git@v1.5#subdirectory=bindings/torch --force-reinstall
1reaction
mablcommented, Dec 18, 2022

The problem here is that nerfstudio hard-codes the CUDA architecture version in the Docker skript (TCNN_CUDA_ARCHITECTURES). When run on a GPU with lower than the default 8.5 architecture, a bug in tiny-cuda-nn is triggered in a code path that is supposed to tell you, that no backend for your architecture has been found.

Try either removing the environmental variable definition or lower the the architecture to match your hardware.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - NameError: name 'C' is not defined` error Converting ...
For example, when temperature F = -400 I get a NameError: name 'C' is not defined error. I tried changed the line position...
Read more >
NameError: name 'c' is not defined - Discussions on Python.org
old, old C programmer, new to Python3. File “/Users/john/Dropbox/Code/PROJECTS/Free Cell/Display/testcoord.py”, line 4, in coordstotext
Read more >
Python nameerror name is not defined Solution - Career Karma
A NameError is raised when you try to use a variable or a function name that is not valid. In Python, code runs...
Read more >
NameError: name 'X' is not defined in Python | bobbyhadz
The Python "NameError: name is not defined" occurs when we try to access a variable or function that is not defined or before...
Read more >
Nameerror name is not defined Python : The detail guide
A NameError is raised when you try to use a variable or a function name that is not valid. In Python, code runs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found