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

Trouble installing torch-scatter #106

Closed
Yannick-S opened this issue Feb 28, 2019 · 6 comments
Closed

Trouble installing torch-scatter #106

Yannick-S opened this issue Feb 28, 2019 · 6 comments

Comments

@Yannick-S
Copy link
Contributor

I am having trouble installing torch-scatter on my local machine. I have a old cpu (9 years or so) and a 970gpu.
I installed torch via
pip3 install torch torchvision
and

python -c "import torch; print(torch.version)"

1.0.1.post2
python -c "import torch; print(torch.cuda.is_available())"

True

nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17

gcc --version

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So good so far, i hope. After adding the PATH and CPATH as suggested in the 'install' documentation, I do
$ git clone https://github.com/rusty1s/pytorch_scatter
$ cd pytorch_scatter
$ python setup.py install

with the following output

running install
running bdist_egg
running egg_info
writing torch_scatter.egg-info/PKG-INFO
writing dependency_links to torch_scatter.egg-info/dependency_links.txt
writing top-level names to torch_scatter.egg-info/top_level.txt
reading manifest file 'torch_scatter.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'torch_scatter.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'torch_scatter.scatter_cuda' extension
gcc -pthread -B /home/j-pc-ub/anaconda3/envs/masterthesis/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include/TH -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/include -I/home/j-pc-ub/anaconda3/envs/masterthesis/include/python3.7m -c cuda/scatter.cpp -o build/temp.linux-x86_64-3.7/cuda/scatter.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/bin/nvcc -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include/TH -I/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/include -I/home/j-pc-ub/anaconda3/envs/masterthesis/include/python3.7m -c cuda/scatter_kernel.cu -o build/temp.linux-x86_64-3.7/cuda/scatter_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(36): error: identifier "__builtin_ia32_monitorx" is undefined

/usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(42): error: identifier "__builtin_ia32_mwaitx" is undefined

/home/j-pc-ub/anaconda3/envs/masterthesis/lib/python3.7/site-packages/torch/lib/include/c10/Half-inl.h(21): error: identifier "__half_as_short" is undefined

3 errors detected in the compilation of "/tmp/tmpxft_00000ea0_00000000-7_scatter_kernel.cpp1.ii".
error: command '/usr/bin/nvcc' failed with exit status 2

Any suggestsions?

@Yannick-S
Copy link
Contributor Author

I seperate this into two comments becasue its two approaches:
I also tried simply installing via pip install torch-scatter. This gives no errors, but doing

python -c "import torch; import torch_scatter"

Traceback (most recent call last):
File "", line 1, in
File "/home/j-pc-ub/Documents/installs/pytorch_scatter/torch_scatter/init.py", line 3, in
from .mul import scatter_mul
File "/home/j-pc-ub/Documents/installs/pytorch_scatter/torch_scatter/mul.py", line 3, in
from torch_scatter.utils.ext import get_func
File "/home/j-pc-ub/Documents/installs/pytorch_scatter/torch_scatter/utils/ext.py", line 5, in
import torch_scatter.scatter_cuda
ModuleNotFoundError: No module named 'torch_scatter.scatter_cuda'

@Yannick-S
Copy link
Contributor Author

I tried several other approaches, but i believe the main issue lies in the
/usr/bin/nvcc ... call. Any ideas what could be causing this and how to get rid of the problem?

@rusty1s
Copy link
Member

rusty1s commented Feb 28, 2019

Have you tried to google the error message? (e.g. NVIDIA/nccl#29)

It seems solvable by adding the following CXX flags:
-D_MWAITXINTRIN_H_INCLUDED
-D_FORCE_INLINES
-D__STRICT_ANSI__

@Yannick-S
Copy link
Contributor Author

Yes i looked at that. But i have
nvcc --version:
Cuda compilation tools, release 7.5, V7.5.17
Is that an issue. I am upgrading my whole cuda world right now to see what happens next.
If this doesn't help i will look more int ot he CXX flags

@rusty1s
Copy link
Member

rusty1s commented Feb 28, 2019

I've never tested it with CUDA 7.5. Hopefully CUDA 8 might fix this issue.

@Yannick-S
Copy link
Contributor Author

success with cuda 9.2! Thanks anyways!

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

2 participants