torchinterp1d
torchinterp1d copied to clipboard
Cannot build torchsearchsorted under ubuntu 16.04
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?
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 ?
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?
damn, which version of cuda are you using?
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.. :\
I tried something else, sorry for the inconvenience. Could you please start again pulling torchsearchsorted
and installing again ?
Not much progress.. X)
are you using torch 1.0 ?
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.
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
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 :)
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
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
true, although having a cast that works on cuda < 10 is probably just a trivial change of one line. I'd welcome it gladly
I've got the test.py case working in 16.04 with cuda9.2, as an FYI.