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

Cannot build torchsearchsorted under ubuntu 16.04 #3

Open
iago-lito opened this issue Mar 21, 2019 · 14 comments
Open

Cannot build torchsearchsorted under ubuntu 16.04 #3

iago-lito opened this issue Mar 21, 2019 · 14 comments

Comments

@iago-lito
Copy link

iago-lito commented Mar 21, 2019

Following the instructions given there, I get the following error running python setup.py install:

torchsearchsorted/cuda/searchsorted_cuda_kernel.cu(131): error: more than one instance of overloaded function "fmax" matches the argument list:
            function "fmax(double, double)"
            function "fmax(float, float)"
            argument types are: (int64_t, int64_t)

torchsearchsorted/cuda/searchsorted_cuda_kernel.cu(137): error: more than one instance of overloaded function "fmin" matches the argument list:
            function "fmin(double, double)"
            function "fmin(float, float)"
            argument types are: (int, int64_t)

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

The machine I try to compile it on is quite not up-to-date I think. However, I cannot upgrade it for I have no root access :\

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
$ 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

Yet the hardware is good :P

$ nvidia-smi
Thu Mar 21 19:05:37 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.130                Driver Version: 384.130                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:03:00.0 Off |                  N/A |
|  0%   29C    P0    57W / 250W |      0MiB / 11172MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

What should I do?

@aliutkus
Copy link
Owner

aliutkus commented Mar 22, 2019

hi @iago-lito ,
I tried to modify the fmin and fmax to use std::min and std::max instead. Probably this was the pb

could you try again to pull the torchsearchsorted repo and install it ?

@iago-lito
Copy link
Author

iago-lito commented Mar 22, 2019

Thank you for support :)

I did. Well, this step passed, but a whole bunch of new ones followed :\ See the complete output here.

Would it be a problem with compilers / cuda / python versions?

@aliutkus
Copy link
Owner

damn, which version of cuda are you using?

@iago-lito
Copy link
Author

iago-lito commented Mar 22, 2019

Wops, I didn't write the whole output, sorry for that:

$ 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

This is rather old I think. I'm in touch with the admin, but there is no guarantee it'll be upgraded soon.. :\

@aliutkus
Copy link
Owner

I tried something else, sorry for the inconvenience. Could you please start again pulling torchsearchsorted and installing again ?

@iago-lito
Copy link
Author

Not much progress.. X)

@aliutkus
Copy link
Owner

are you using torch 1.0 ?

@iago-lito
Copy link
Author

Yupe:

$ pip3 show torch
Name: torch
Version: 1.0.1.post2
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: /usr/local/lib/python3.5/dist-packages
Requires: 
Required-by: 
You are using pip version 18.0, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

@aliutkus
Copy link
Owner

OK, I'm sorry since I cannot reproduce the bug, I got difficulties fixing it.

Could you investigate the problem ? It seems to be around these fmin and fmax calls. Maybe you find some other way to do the same computations ? If you manage, I'd be glad to have a pull request

@iago-lito
Copy link
Author

I understand. I'll do my best. But I won't if an simple upgrade fixes the error, and I will investigate this option first.
Thank you for support anyway :)

@aliutkus
Copy link
Owner

that was quick

yeah, this is all working on cuda 10. I did not test, but it's clearly a pity that such a stupid cast between integers is causing so much troubles. I apologize for this

@lkn2993
Copy link

lkn2993 commented May 12, 2019

I guess this implementation only works on cuda 10.
It doesn't build on cuda 9 or 8 version of pytorch, as it returns an invalid cast error.
python36\lib\site-packages\torch\lib\include\pybind11\cast.h(1439): error: expression must be a pointer to a complete object type

@aliutkus
Copy link
Owner

true, although having a cast that works on cuda < 10 is probably just a trivial change of one line. I'd welcome it gladly

@crvogt
Copy link

crvogt commented Oct 11, 2019

I've got the test.py case working in 16.04 with cuda9.2, as an FYI.

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

4 participants