sxyu / svox2

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

CUDA isn't working #13

Open decadance-dance opened 2 years ago

decadance-dance commented 2 years ago

I finished installing COLMAP and creating env with requirements. When i run python render_imgs_circle.py I have got CUDA exception.

/home/NIX/dronov/anaconda3/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 NeRF (Blender) dataset
LOAD DATA /home/NIX/dronov/HDD/datasets/3D/256_to_512_fasttv/ficus/data/test
100%|█████████████████████████████████████████| 200/200 [00:04<00:00, 43.17it/s]
  Auto vec_up [-5.03970733e-04  8.00918526e-03  9.99967799e-01]
Traceback (most recent call last):
  File "render_imgs_circle.py", line 166, in <module>
    grid = svox2.SparseGrid.load(args.ckpt, device=device)
  File "/home/NIX/dronov/anaconda3/envs/plenoxel/lib/python3.8/site-packages/svox2/svox2.py", line 1627, in load
    grid.accelerate()
  File "/home/NIX/dronov/anaconda3/envs/plenoxel/lib/python3.8/site-packages/svox2/svox2.py", line 1491, in accelerate
    assert (
AssertionError: CUDA extension is currently required for accelerate

Help me fix it, please

sxyu commented 2 years ago

Hi, This means that the CUDA extension failed to build. Did you run pip install . on the svox2 root? If so, did you see any errors/warnings when doing so? Also, what is your GPU and CUDA version?

Fangkang515 commented 2 years ago

This seems to be a general problem, I have the same error:

    assert (
AssertionError: CUDA extension is currently required for accelerate

and, my cuda version shows below:

image GPU is 1080Ti.

Do you have any idea to fix it? Help me please. Thank you very much!

Realitian commented 2 years ago

I also got Please do not import svox in the svox2 source directory, when I run the to_svox1.py. For the debugging, I tried to just import svox and svox2 only in python file. But, when I import one svox or svox2, then above message does not show. but if I import both svox and svox2 at the same time, then I can get this message. I am curious if two cuda module has conflict. Could you give me hint to resolve this issue when I run the to_svox1.py, @sxyu ? Thank you in advance for your help!

SSground commented 2 years ago

I have the same problem, but this does not seem to affect the final result

yyang9887 commented 2 years ago

I have the same error.

Traceback (most recent call last): File "opt.py", line 285, in grid = svox2.SparseGrid(reso=reso_list[reso_id], File "/home/iaj/.conda/envs/plenoxel/lib/python3.8/site-packages/svox2/svox2.py", line 535, in init self.accelerate() File "/home/iaj/.conda/envs/plenoxel/lib/python3.8/site-packages/svox2/svox2.py", line 1491, in accelerate assert ( AssertionError: CUDA extension is currently required for accelerate

decadance-dance commented 2 years ago

I fixed it for myself. First, look at your GPU drivers and their CUDA compatibility. You must have a full CUDA driver installed. I installed myself version 11.3. https://developer.nvidia.com/cuda-11.3.0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_local After installing CUDA, I registered the paths CUDA_HOME, CUB_HOME Next, I collected the environment.

conda env create -f environment.yml
conda activate plenoxels

Make sure that your conda environment does not already have libraries related to svox2 and svox. And manually executed the command python setup.py install from the root of the repository. After that, I ran the command pip install . The svox2 library appeared in the trace in the list of libraries in my environment. Attention, avoid the simultaneous presence of svox2 and svox in the environment. image