sxyu / svox2

Plenoxels: Radiance Fields without Neural Networks
BSD 2-Clause "Simplified" License
2.79k stars 359 forks source link

CUDA extension svox2.csrc could not be loaded? #15

Open IMath123 opened 2 years ago

IMath123 commented 2 years ago

python opt.py /home/dingwuyou/Downloads/NeRF_Data/nerf_llff_data/flower -c configs/llff.json /home/dingwuyou/.conda/envs/plenoxel/lib/python3.8/site-packages/svox2/utils.py:39: UserWarning: CUDA extension svox2.csrc could not be loaded! Operations will be slow. Please do not import svox in the svox2 source directory. warn("CUDA extension svox2.csrc could not be loaded! " + Detected LLFF dataset Using pre-scaled images from /home/dingwuyou/Downloads/NeRF_Data/nerf_llff_data/flower/images_4 Loaded LLFF data /home/dingwuyou/Downloads/NeRF_Data/nerf_llff_data/flower 22.573735200863933 222.47985705021057 recentered (3, 4) [ 1.4332432 12.709555 ] Overriding offset 250-> 250 dmin = 1.433243, dmax = 12.709555, invz = 0, offset = 250 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 29/29 [00:00<00:00, 39.39it/s] z_bounds from LLFF: [1.4332431554794312, 12.709554672241211] (not used) scene_radius [1.496031746031746, 1.6613756613756614, 1.0] Generating rays, scaling factor 1 /home/dingwuyou/.conda/envs/plenoxel/lib/python3.8/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1639180588308/work/aten/src/ATen/native/TensorShape.cpp:2157.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Detected LLFF dataset Using pre-scaled images from /home/dingwuyou/Downloads/NeRF_Data/nerf_llff_data/flower/images_4 Loaded LLFF data /home/dingwuyou/Downloads/NeRF_Data/nerf_llff_data/flower 22.573735200863933 222.47985705021057 recentered (3, 4) [ 1.4332432 12.709555 ] Overriding offset 250-> 250 dmin = 1.433243, dmax = 12.709555, invz = 0, offset = 250 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 41.58it/s] 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 120/120 [00:00<00:00, 167548.76it/s] z_bounds from LLFF: [1.4332431554794312, 12.709554672241211] (not used) scene_radius [1.496031746031746, 1.6613756613756614, 1.0] Morton code requires a cube grid of power-of-2 size, ignoring... Render options RenderOptions(backend='cuvol', background_brightness=0.5, step_size=0.5, sigma_thresh=1e-08, stop_thresh=1e-07, last_sample_opaque=False, near_clip=0.0, use_spheric_clip=False, random_sigma_std=0.0, random_sigma_std_background=0.0) Selecting random rays Eval step 0%| | 0/5 [00:00<?, ?it/s] Traceback (most recent call last): File "opt.py", line 471, in eval_step() File "opt.py", line 406, in eval_step rgb_pred_test = grid.volume_render_image(cam, use_kernel=True) File "/home/dingwuyou/.conda/envs/plenoxel/lib/python3.8/site-packages/svox2/svox2.py", line 1159, in volume_render_image if self.basis_type != BASIS_TYPE_MLP and imrend_fn_name in _C.dict and not torch.is_grad_enabled() and not return_raylen: AttributeError: 'NoneType' object has no attribute 'dict'

IMath123 commented 2 years ago

I have run (pip install .) and got no errors/warnings. My CUDA version is 11.4, GPU is 1080Ti

SSground commented 2 years ago

Hi,sir maybe you should pip install jaxlib https://storage.googleapis.com/jax-releases/jax_releases.html

IMath123 commented 2 years ago

Hi,sir maybe you should pip install jaxlib https://storage.googleapis.com/jax-releases/jax_releases.html

I've tried and i still get the same error

Jia-Wei-Liu commented 2 years ago

Hi, I encounter the same problem. The pip install . does not report any problem, and I also tried to install jaxlib. But I still get the same error: CUDA extension svox2.csrc could not be loaded I tried different python and torch version but still cannot work. Could you please help? Many thanks!

Junwei-LV commented 2 years ago

is there any resulotions about this error? I have got the same problem

jianchong-chen commented 2 years ago

Me too! And I am running this code on windows, the jaxlib can only be installed on linux....

Junwei-LV commented 2 years ago

I have run (pip install .) and got no errors/warnings. My CUDA version is 11.4, GPU is 1080Ti

I try to pip install . in the main location
but always error, so where to pip install . many thanks

Icecream98 commented 2 years ago

Hi, After 2 days searching, I finally fixed this problem. First you should check your GPU drivers and CUDA, CuDNN compatibility. My conda environment list below(Python 3.8.8, Ubuntu 20.04, cuda11.1, cudnn8.2.1.32) jax 0.2.26 jaxlib 0.1.74+cuda11.cudnn82 pip 21.2.4 svox 0.2.32 tensorboard 2.7.0 tensorflow-gpu 2.5.0 torch 1.8.0+cu111 torchvision 0.9.0+cu111

The reason you have this problem is because you didn't correctly install svox to have the document in the red box in the picture. image

You can install svox from source code to see more installing informations, install this git repository to your own computer, run the following command to install svox. MAX_JOBS=16 pip3 install -vvv . After running this command, your terminal should show you a lot of logs, you should carefully read it. Like my log is:

unable to execute '/usr/local/cuda-11.1:/bin/nvcc': No such file or directory
warning: BuildExtension: building extension "svox.csrc" failed: command '/usr/local/cuda-11.1:/bin/nvcc' failed with exit status 1

I first check my cuda directory '/usr/local/cuda-11.1', it didn't have '/bin/nvcc'. (Because I forget to install cudnn in it.) Then I install cudnn from nvidia website, rerun the command to install svox from source code, it still shows the same error log.

And I check my nvcc directory existence ('/usr/local/cuda-11.1/bin/nvcc') to make sure the script can find it. The error log said it can't find '/usr/local/cuda-11.1:/bin/nvcc'. There's an extra colon ':' in it. Then I check my /.bashrc file, finally find the problem!

My orginal /.bashrc file is 'export CUDA_HOME="/usr/local/cuda-11.1:$CUDA_HOME' I FOUND THE EXTRA COLON ! After changed it to 'export CUDA_HOME="/usr/local/cuda-11.1', svox in Site-packages in python directory have a file named 'csrc.cpython-38-x86_64-linux-gnu.so'. I solved this problem. Yeah!

image func _get_c_extension() return value is not None. image

yyReater commented 2 years ago

Hi, After 2 days searching, I finally fixed this problem. First you should check your GPU drivers and CUDA, CuDNN compatibility. My conda environment list below(Python 3.8.8, Ubuntu 20.04, cuda11.1, cudnn8.2.1.32) jax 0.2.26 jaxlib 0.1.74+cuda11.cudnn82 pip 21.2.4 svox 0.2.32 tensorboard 2.7.0 tensorflow-gpu 2.5.0 torch 1.8.0+cu111 torchvision 0.9.0+cu111

The reason you have this problem is because you didn't correctly install svox to have the document in the red box in the picture. image

You can install svox from source code to see more installing informations, install this git repository to your own computer, run the following command to install svox. MAX_JOBS=16 pip3 install -vvv . After running this command, your terminal should show you a lot of logs, you should carefully read it. Like my log is:

unable to execute '/usr/local/cuda-11.1:/bin/nvcc': No such file or directory
warning: BuildExtension: building extension "svox.csrc" failed: command '/usr/local/cuda-11.1:/bin/nvcc' failed with exit status 1

I first check my cuda directory '/usr/local/cuda-11.1', it didn't have '/bin/nvcc'. (Because I forget to install cudnn in it.) Then I install cudnn from nvidia website, rerun the command to install svox from source code, it still shows the same error log.

And I check my nvcc directory existence ('/usr/local/cuda-11.1/bin/nvcc') to make sure the script can find it. The error log said it can't find '/usr/local/cuda-11.1:/bin/nvcc'. There's an extra colon ':' in it. Then I check my /.bashrc file, finally find the problem!

My orginal /.bashrc file is 'export CUDA_HOME="/usr/local/cuda-11.1:$CUDA_HOME' I FOUND THE EXTRA COLON ! After changed it to 'export CUDA_HOME="/usr/local/cuda-11.1', svox in Site-packages in python directory have a file named 'csrc.cpython-38-x86_64-linux-gnu.so'. I solved this problem. Yeah!

image func _get_c_extension() return value is not None. image

牛逼

LitterWindwind commented 2 years ago

Hi, After 2 days searching, I finally fixed this problem. First you should check your GPU drivers and CUDA, CuDNN compatibility. My conda environment list below(Python 3.8.8, Ubuntu 20.04, cuda11.1, cudnn8.2.1.32) jax 0.2.26 jaxlib 0.1.74+cuda11.cudnn82 pip 21.2.4 svox 0.2.32 tensorboard 2.7.0 tensorflow-gpu 2.5.0 torch 1.8.0+cu111 torchvision 0.9.0+cu111

The reason you have this problem is because you didn't correctly install svox to have the document in the red box in the picture. image

You can install svox from source code to see more installing informations, install this git repository to your own computer, run the following command to install svox. MAX_JOBS=16 pip3 install -vvv . After running this command, your terminal should show you a lot of logs, you should carefully read it. Like my log is:

unable to execute '/usr/local/cuda-11.1:/bin/nvcc': No such file or directory
warning: BuildExtension: building extension "svox.csrc" failed: command '/usr/local/cuda-11.1:/bin/nvcc' failed with exit status 1

I first check my cuda directory '/usr/local/cuda-11.1', it didn't have '/bin/nvcc'. (Because I forget to install cudnn in it.) Then I install cudnn from nvidia website, rerun the command to install svox from source code, it still shows the same error log.

And I check my nvcc directory existence ('/usr/local/cuda-11.1/bin/nvcc') to make sure the script can find it. The error log said it can't find '/usr/local/cuda-11.1:/bin/nvcc'. There's an extra colon ':' in it. Then I check my /.bashrc file, finally find the problem!

My orginal /.bashrc file is 'export CUDA_HOME="/usr/local/cuda-11.1:$CUDA_HOME' I FOUND THE EXTRA COLON ! After changed it to 'export CUDA_HOME="/usr/local/cuda-11.1', svox in Site-packages in python directory have a file named 'csrc.cpython-38-x86_64-linux-gnu.so'. I solved this problem. Yeah!

image func _get_c_extension() return value is not None. image

I have this file already. I only met this error when I use pycharm to debug the code, strange....

Maguire1999 commented 2 years ago

I also have this problem when debugging with pycharm, the solution is to copy the csrc.cpython-38-x86_64-linux-gnu.so file to your code directory ./Plenoxels/svox2/ image

WesternTrail commented 1 year ago

我用pycharm调试的时候也出现这个问题,解决方法是将csrc.cpython-38-x86_64-linux-gnu.so文件复制到你的代码目录./Plenoxels/svox2/ 图片

thank you!it works

yankeee-0411 commented 1 year ago

I got the same problem~ Where can I get the csrc.cpython-38-x86_64-linux-gnu.so document? Thank you.

WesternTrail commented 1 year ago

I got the same problem~ Where can I get the csrc.cpython-38-x86_64-linux-gnu.so document? Thank you.

After you execute pip install After the operation is correct (it may take a long time to wait), this file will appear in the folder '/home/ming/anaconda3/envs/plenoxel/lib/python3.8/site-packages/svox2', which can be moved

liaohuanxuan commented 9 months ago

My conda environment(Python 3.8.8, Ubuntu 22.04, cuda11.8) I have csrc.cpython-38-x86_64-linux-gnu.so, but still have the problem CUDA extension svox.csrc could not be loaded!