Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pointops module - cuda extensions on windows #20

Open
anassmu opened this issue Jan 21, 2023 · 11 comments
Open

pointops module - cuda extensions on windows #20

anassmu opened this issue Jan 21, 2023 · 11 comments

Comments

@anassmu
Copy link

anassmu commented Jan 21, 2023

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.

@raespanha
Copy link

raespanha commented Jan 23, 2023

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

@anassmu
Copy link
Author

anassmu commented Jan 23, 2023

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 :)

@raespanha
Copy link

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

@anassmu
Copy link
Author

anassmu commented Jan 24, 2023

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 :) !

@raespanha
Copy link

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.

@anassmu
Copy link
Author

anassmu commented Jan 24, 2023

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
Copy link
Author

anassmu commented Jan 25, 2023

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

@raespanha
Copy link

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

@fenfenglitech
Copy link

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!

@raespanha
Copy link

@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.

@fenfenglitech
Copy link

fenfenglitech commented Jan 27, 2023

@raespanha thank you, i have sovled my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants