Skip to content

ModuleNotFoundError: No module named 'scatter_cuda' #8

Closed
@shagunsodhani

Description

@shagunsodhani

Hey

I am trying to use the package. I installed it via both pip and source. It works fine on the cpu but when I try to import scatter_cuda on a gpu, it gives me the following error:

from torch_scatter import scatter_max

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/u/sodhanis/anaconda3/envs/torch4/lib/python3.6/site-packages/torch_scatter/__init__.py", line 3, in <module>
    from .mul import scatter_mul
  File "/u/sodhanis/anaconda3/envs/torch4/lib/python3.6/site-packages/torch_scatter/mul.py", line 3, in <module>
    from torch_scatter.utils.ext import get_func
  File "/u/sodhanis/anaconda3/envs/torch4/lib/python3.6/site-packages/torch_scatter/utils/ext.py", line 5, in <module>
    import scatter_cuda
ModuleNotFoundError: No module named 'scatter_cuda'

I made sure to check te pytorch version ('0.4.1') and setup $PATH and $CPATH . For reference, they look like

$PATH=...anaconda3/envs/torch0.4.1/bin::/usr/local/cuda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/sbin:/usr/sbin:/sbin
$CPATH=/usr/local/cuda/include

Edit:

Running python3 setup.py test returns

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/u/sodhanis/anaconda3/envs/torch4/lib/python3.6/site-packages/torch/lib/include -I/u/sodhanis/anaconda3/envs/torch4/lib/python3.6/site-packages/torch/lib/include/TH -I/u/sodhanis/anaconda3/envs/torch4/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/u/sodhanis/anaconda3/envs/torch4/include/python3.6m -c cuda/scatter_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/scatter_kernel.o -DTORCH_EXTENSION_NAME=scatter_cuda -D_GLIBCXX_USE_CXX11_ABI=0 --compiler-options '-fPIC' -std=c++11
/u/sodhanis/anaconda3/envs/torch4/lib/python3.6/site-packages/torch/lib/include/ATen/Half-inl.h(17): error: identifier "__half_as_short" is undefined

1 error detected in the compilation of "/tmp/tmpxft_00001462_00000000-7_scatter_kernel.cpp1.ii".
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions