svox2 icon indicating copy to clipboard operation
svox2 copied to clipboard

AssertionError: CUDA extension is currently required for accelerate

Open puallee opened this issue 3 years ago • 8 comments

I still have the probelm of AssertionError: CUDA extension is currently required for accelerate ubuntu@ubuntu-broncus:/erick/rendering/svox2-master/svox2-master/opt$ python3.8 render_imgs.py /home/raid/erickData/data/TanksAndTempleBG/Train/ ../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! " + Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off] Loading model from: /home/ubuntu/.local/lib/python3.8/site-packages/lpips/weights/v0.1/vgg.pth Defaulting to extended NSVF dataset LOAD NSVF DATA /home/raid/erickData/data/TanksAndTempleBG/Train/ split test 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 43/43 [00:00<00:00, 58.04it/s] NORMALIZE BY? camera scene_scale 2.0069090349061196 intrinsics (loaded reso) Intrin(fx=580.62451171875, fy=580.62451171875, cx=490.75, cy=273.0) Traceback (most recent call last): File "render_imgs.py", line 116, in grid = svox2.SparseGrid.load(args.ckpt, device=device) File "../svox2/svox2.py", line 1629, in load grid.accelerate() File "../svox2/svox2.py", line 1491, in accelerate assert ( AssertionError: CUDA extension is currently required for accelerate Can some help me ,my environment is python3.8 torch 1.8.0+cu111 nvidia driver 460.91.03 gpu 3090 ,torchaudio 0.8.0 torchvision 0.9.0+cu111 and gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu118.04)

puallee avatar Jan 29 '22 02:01 puallee

I faced this issue, so basically pip install haven't compile CUDA extension without any warning. Te see what you need to compile do

cd svox2
cmake csrc
make -j 1

When you make sure it compiles just reinstall svox2 with pip, this time it should compile the extension.

pip uninstall svox2
pip install .

parilo avatar Feb 04 '22 09:02 parilo

I faced this issue, so basically pip install haven't compile CUDA extension without any warning. Te see what you need to compile do

cd svox2
cmake csrc
make -j 1

When you make sure it compiles just reinstall svox2 with pip, this time it should compile the extension.

pip uninstall svox2
pip install .

I use your method, but it cannot work.

(plenoxel) root@fe4eb987aa96:.../svox2/opt# python
Python 3.8.8 (default, Apr 13 2021, 19:58:26)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import csrc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'csrc'
>>> import svox2.csrc
/opt/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! " +
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /opt/conda/envs/plenoxel/lib/python3.8/site-packages/svox2/csrc.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor7is_cudaEv

how can I solve the question ?

laulampaul avatar Feb 18 '22 04:02 laulampaul

When I use terminal to run, it's ok. But when I use pycharm to debug the code, I meet the same error. I have tried on three different machine, which is strange.

LitterWindwind avatar Apr 26 '22 07:04 LitterWindwind


how can I solve the question ?

I didn't have this issue. It seems that either csrc.cpython-38-x86_64-linux-gnu.so wasn't linked with some library properly or this library doesn't load when you import csrc. Please read carefully messages during csrc compilation. When you do cmake and make. Maybe you spot something.

parilo avatar Apr 26 '22 09:04 parilo

I meet the same problem~

kamen007 avatar Jun 01 '22 07:06 kamen007

I meet the same problem~

I solve the issue by using docker. I hope it can help you.

laulampaul avatar Jun 01 '22 07:06 laulampaul

Hi @laulampaul, can you please share your Dockerfile?

Utopiah avatar Aug 09 '22 09:08 Utopiah

Reason: the compiled package name and the folder name in the project are both "svox2", they will be mis-imported when using in the opt.py script. Solution: aftering "pip install .", just simply remove the folder"./svox2/svox2". Then everything will work

muxizju avatar Nov 23 '22 06:11 muxizju