rusty1s / pytorch_unique

PyTorch Extension Library of Optimized Unique Operation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building problem

allchemist opened this issue · comments

Hello,

i have problems building pytorch_unique at a machine with gpu. At a no-gpu machine it is ok, no gpu - no problem :)

running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/test
copying test/test_unique.py -> build/lib.linux-x86_64-3.6/test
copying test/__init__.py -> build/lib.linux-x86_64-3.6/test
copying test/utils.py -> build/lib.linux-x86_64-3.6/test
creating build/lib.linux-x86_64-3.6/torch_unique
copying torch_unique/unique.py -> build/lib.linux-x86_64-3.6/torch_unique
copying torch_unique/__init__.py -> build/lib.linux-x86_64-3.6/torch_unique
running build_ext
building 'unique_cuda' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/cuda
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/torch/lib/include -I/usr/local/lib/python3.6/dist-packages/torch/lib/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/lib/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/unique.cpp -o build/temp.linux-x86_64-3.6/cuda/unique.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=unique_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
In file included from cuda/unique.cpp:1:0:
/usr/local/lib/python3.6/dist-packages/torch/lib/include/torch/csrc/api/include/torch/torch.h:7:2: warning: #warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/extension.h" [-Wcpp]
 #warning \
  ^~~~~~~
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.6/dist-packages/torch/lib/include -I/usr/local/lib/python3.6/dist-packages/torch/lib/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/lib/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/include/python3.6m -c cuda/unique_kernel.cu -o build/temp.linux-x86_64-3.6/cuda/unique_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=unique_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cuda/unique_kernel.cu(22): error: no suitable user-defined conversion from "at::Type" to "c10::IntList" exists

cuda/unique_kernel.cu(22): error: no instance of constructor "at::TensorOptions::TensorOptions" matches the argument list
            argument types are: (int64_t)

2 errors detected in the compilation of "/tmp/tmpxft_000009f2_00000000-6_unique_kernel.cpp1.ii".
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

pytorch itself, pytorch_geometric and its requirements (pytorch-scatter,cluster,sparse,spline-conv) are installed successfully, though import torch_sparse brings import error for 'unique_cuda'.
torch.cuda.is_available() says True, and tensor operations at gpu are working fine.

If the problem could be with my system, what can i possibly do with it?

Hi,
torch_unique is deprecated and no longer in use for torch_geometric. It even can not be installed anymore on PyTorch 1.0. However, torch_sparse builds a unique kernel to speeden up some things, and it has the same name „unique_cuda“. I see that this is a problem and will add namespaces to it. For your installation, you should remove torch_unique and rebuild torch_sparse.

Thanks! yes, i saw the message about missing 'unique_cuda' and tried to install torch_unique to fix that. Thanks for answer!