alexandrosstergiou / SoftPool

[ICCV 2021] Code for approximated exponential maximum pooling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

100+ errors detected in the compilation of softpool_cuda_kernel.cu

wlcosta opened this issue · comments

commented

Hey. I am getting a few errors during the installation process.
Into the SoftPool/pytorch folder, I run make install as explained in the README file, and during the process, three errors show up in the console repeatedly:

CUDA/softpool_cuda_kernel.cu(252): error: type name is not allowed
CUDA/softpool_cuda_kernel.cu(252): error: expected an expression
CUDA/softpool_cuda_kernel.cu(252): error: a pointer to a bound function may only be used to call the function

And then:

Error limit reached.
100 errors detected in the compilation of "CUDA/softpool_cuda_kernel.cu".
Compilation terminated.
error: command '/usr/local/cuda-11.3/bin/nvcc' failed with exit status 1
Makefile:2: recipe for target 'install' failed
make: *** [install] Error 1

For quick inspection, here are the lines that are causing the error (at least the first 100 of them). It looks like the issue is with AT_DISPATCH_FLOATING_TYPES_AND_HALF:

AT_DISPATCH_FLOATING_TYPES_AND_HALF(
input.scalar_type(), "SoftPool1dLauncherForward", ([&] {
const scalar_t *bottom_input = input.data_ptr<scalar_t>();
scalar_t *output_data = output.data_ptr<scalar_t>();
SoftPool1dForward<scalar_t>
<<<GET_BLOCKS(output_size), THREADS_PER_BLOCK>>>(
output_size, bottom_input,
batches, channels,
dim, kernel_d,
stride_d, output_data);
})
);

AT_DISPATCH_FLOATING_TYPES_AND_HALF(
input.scalar_type(), "SoftPool2dLauncherForward", ([&] {
const scalar_t *bottom_input = input.data_ptr<scalar_t>();
scalar_t *output_data = output.data_ptr<scalar_t>();
SoftPool2dForward<scalar_t>
<<<GET_BLOCKS(output_size), THREADS_PER_BLOCK>>>(
output_size, bottom_input,
batches, channels,
height, width,
kernel_h, kernel_w,
stride_h, stride_w,
output_data);
})
);

AT_DISPATCH_FLOATING_TYPES_AND_HALF(
input.scalar_type(), "SoftPool3dLauncherForward", ([&] {
const scalar_t *bottom_input = input.data_ptr<scalar_t>();
scalar_t *output_data = output.data_ptr<scalar_t>();
SoftPool3dForward<scalar_t>
<<<GET_BLOCKS(output_size), THREADS_PER_BLOCK>>>(
output_size, bottom_input,
batches, channels,
depth, height,
width, kernel_d,
kernel_h, kernel_w,
stride_d, stride_h,
stride_w, output_data);
})
);

AT_DISPATCH_FLOATING_TYPES_AND_HALF(
input.scalar_type(), "SoftPool1dLauncherBackward", ([&] {
scalar_t *diff_input = input_grad.data_ptr<scalar_t>();
const scalar_t *diff_output = output_grad.data_ptr<scalar_t>();
const scalar_t *data_input = input.data_ptr<scalar_t>();
SoftPool1dBackward<scalar_t>
<<<GET_BLOCKS(output_size), THREADS_PER_BLOCK>>>(
output_size, diff_output,
data_input, batches,
channels, dim,
kernel_d, stride_d,
diff_input);
}
)
);

AT_DISPATCH_FLOATING_TYPES_AND_HALF(
input.scalar_type(), "SoftPool2dLauncherBackward", ([&] {
scalar_t *diff_input = input_grad.data_ptr<scalar_t>();
const scalar_t *diff_output = output_grad.data_ptr<scalar_t>();
const scalar_t *data_input = input.data_ptr<scalar_t>();
SoftPool2dBackward<scalar_t>
<<<GET_BLOCKS(output_size), THREADS_PER_BLOCK>>>(
output_size, diff_output,
data_input, batches,
channels, height,
width, kernel_h,
kernel_w, stride_h,
stride_w, diff_input);
}
)
);

I have tried different CUDA versions (9.0, 10.2, 11.3) and different GCC/G++ versions (5, 8 and 9), but no success. I am using Ubuntu 16.04 with an RTX 2080 Ti.

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-23ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-oatUX7/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-23ubuntu1~16.04)

Thanks!

Hi @wlcosta ,

Since you have tried a lot of CUDA and g++ versions together, you should check your CUDA compiler compatibility this table.

As I cannot reproduce the problem, since it's specific to the compiler that you're using, you can check this solution for resolving issues between GCC versions and CUDA. Alternatively, you can also build with --ccbin which may help avoid the current incompatibility issues that you have.

Best,
Alex

Closing this issue for now. Will be interested to get updates, in case that you are able to solve the problem, to include them as a possible solution when other people have installation issues.

Best.
Alex