RepSurf icon indicating copy to clipboard operation
RepSurf copied to clipboard

pointops module - cuda extensions on windows

Open anassmu opened this issue 2 years ago • 11 comments

for the segmentation modules, i didn't manage to install pointops module on windows, any help ? on ubunut it worked just fine.

did anyone managed to install this on windows ? and make it work ?

Thanks a lot.

anassmu avatar Jan 21 '23 15:01 anassmu

I was able to do it after commenting the following lines in setup.py:

from distutils.sysconfig import get_config_vars

(opt,) = get_config_vars('OPT') os.environ['OPT'] = " ".join( flag for flag in opt.split() if flag != '-Wstrict-prototypes' )

These modules are used on many point cloud NN architectures. example: https://github.com/cszyzhang/riconv2/blob/main/models/pointnet2/setup.py

raespanha avatar Jan 23 '23 18:01 raespanha

Thanks for your replay ! I figured out that the opt variable don’t exist on windows and i commented those lines too, still have a problem with cuda_home var path, any suggestions about the environment ( conda pip ) , you run it using visual studio / anaconda .. command prompt ? Thanks :)

anassmu avatar Jan 23 '23 18:01 anassmu

You should make sure you have cuda installed on windows (either original CUDA installation or via conda cudatoolkit). To check if you have cuda on your conda environment run: python -c "import torch; print(torch.cuda.is_available())" It should return true.

Also make sure you installed every step in init.sh until the actual python setup.py install in pointops folder https://github.com/hancyran/RepSurf/blob/main/segmentation/init.sh

raespanha avatar Jan 24 '23 11:01 raespanha

thanks a lot, i maid it work, i just used conda instead of pip to install the required libs and it failed :/, using pip as mentioned in init.sh worked fine :) !

anassmu avatar Jan 24 '23 14:01 anassmu

You are welcome. The next problem you might face may be what I am facing right now: SharedArray module for windows. It is using it to load the data and SharedArray is unlikely to work on windows: https://pypi.org/project/SharedArray/ I tried to install it and failed.

raespanha avatar Jan 24 '23 15:01 raespanha

i resolved it, you can get rid of it (one simple function sa_create in dataset class that you can change), i will share my code :)

anassmu avatar Jan 24 '23 15:01 anassmu

Sorry for my late reply, I’m using S3DIS dataset which i already have ( I’ve downloaded it and preprocessed it following the steps mentioned here ), it’s the same result as in this repo ( you finally get NPY files of parts of different areas 1…6). Then i made few changes to replace SharedArray.

  • In init.sh remove SharedArray install.
  • In util.data_util just remove sa_create function ( the only one using SharedArray ) and the SharedArray import.
  • In dataset.S3DISDataLoader , i removed the SharedArray and sa_create imports and made few changes (i changed init and get_item functions), data_dir contain the NPY files :

dataset.zip

anassmu avatar Jan 25 '23 13:01 anassmu

Thanks so much @anassmu. I ended up doing something similar. Finally, after some path issues I got it working :)

raespanha avatar Jan 26 '23 15:01 raespanha

root@I107146740100401834:/hy-tmp/RepSurf-main/segmentation# sh scripts/s3dis/train_repsurf_umb.sh /hy-tmp/RepSurf-main/segmentation/modules/pointops/functions/pointops.py:14: UserWarning: Unable to load pointops_cuda cpp extension. warnings.warn("Unable to load pointops_cuda cpp extension.") Traceback (most recent call last): File "/hy-tmp/RepSurf-main/segmentation/modules/pointops/functions/pointops.py", line 8, in import pointops_cuda ModuleNotFoundError: No module named 'pointops_cuda' Could you help me please!

fenfenglitech avatar Jan 27 '23 10:01 fenfenglitech

@fenfenglitech It seems you didn't install pointops_cuda properly. you have instructions in init.sh which is a script that creates the anaconda environment and installs the packages atuomatically. I advice atm, to install them 1 by 1. you probably missing the last step which installs the pointops_cuda:

cd modules/pointops python3 setup.py install

If you are running it on windows you might need to change the setup.py as following:

I was able to do it after commenting the following lines in setup.py:

from distutils.sysconfig import get_config_vars

(opt,) = get_config_vars('OPT') os.environ['OPT'] = " ".join( flag for flag in opt.split() if flag != '-Wstrict-prototypes' )

Make sure you have the anaconda env with cuda support.

raespanha avatar Jan 27 '23 10:01 raespanha

@raespanha thank you, i have sovled my problem.

fenfenglitech avatar Jan 27 '23 12:01 fenfenglitech