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

Building fails with GCC error #956

Open
legraphista opened this issue Sep 2, 2020 · 8 comments
Open

Building fails with GCC error #956

legraphista opened this issue Sep 2, 2020 · 8 comments

Comments

@legraphista
Copy link

legraphista commented Sep 2, 2020

.....


    csrc/mlp.cpp:147:48: error: expected primary-expression before ‘)’ token
             grad_o.contiguous().data_ptr<scalar_t>(),
                                                    ^
    /opt/conda/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:10:12: note: in definition of macro ‘AT_PRIVATE_CASE_TYPE’
         return __VA_ARGS__();                          \
                ^
    csrc/mlp.cpp:123:3: note: in expansion of macro ‘AT_DISPATCH_FLOATING_TYPES_AND_HALF’
       AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_backward", [&] {
       ^
    csrc/mlp.cpp:148:43: error: expected primary-expression before ‘>’ token
             fprop_outputs[1].data_ptr<scalar_t>(),
                                               ^
    /opt/conda/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:10:12: note: in definition of macro ‘AT_PRIVATE_CASE_TYPE’
         return __VA_ARGS__();                          \
                ^
    csrc/mlp.cpp:123:3: note: in expansion of macro ‘AT_DISPATCH_FLOATING_TYPES_AND_HALF’
       AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_backward", [&] {
       ^
    csrc/mlp.cpp:148:45: error: expected primary-expression before ‘)’ token
             fprop_outputs[1].data_ptr<scalar_t>(),
                                                 ^
    /opt/conda/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:10:12: note: in definition of macro ‘AT_PRIVATE_CASE_TYPE’
         return __VA_ARGS__();                          \
                ^
    csrc/mlp.cpp:123:3: note: in expansion of macro ‘AT_DISPATCH_FLOATING_TYPES_AND_HALF’
       AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_backward", [&] {
       ^
    csrc/mlp.cpp:149:37: error: expected primary-expression before ‘>’ token
             work_space.data_ptr<scalar_t>(),
                                         ^
    /opt/conda/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:10:12: note: in definition of macro ‘AT_PRIVATE_CASE_TYPE’
         return __VA_ARGS__();                          \
                ^
    csrc/mlp.cpp:123:3: note: in expansion of macro ‘AT_DISPATCH_FLOATING_TYPES_AND_HALF’
       AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_backward", [&] {
       ^
    csrc/mlp.cpp:149:39: error: expected primary-expression before ‘)’ token
             work_space.data_ptr<scalar_t>(),
                                           ^
    /opt/conda/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:10:12: note: in definition of macro ‘AT_PRIVATE_CASE_TYPE’
         return __VA_ARGS__();                          \
                ^
    csrc/mlp.cpp:123:3: note: in expansion of macro ‘AT_DISPATCH_FLOATING_TYPES_AND_HALF’
       AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_backward", [&] {
       ^
    error: command 'gcc' failed with exit status 1

python -V:

Python 3.6.8 :: Anaconda, Inc.

gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.11' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 

using docker image: nvcr.io/nvidia/pytorch:19.04-py3 as detailed in the installation section of https://github.com/NVIDIA/unsupervised-video-interpolation

@super233
Copy link

super233 commented Oct 5, 2020

I encountered the same error, did you have solved it?

@5Yesterday
Copy link

I meet it too, request answer.

@super233
Copy link

super233 commented Oct 8, 2020

Have a look at #802, it's useful for me. @5Yesterday @legraphista

@5Yesterday
Copy link

Thanks, it works.

@hhaoyan
Copy link

hhaoyan commented Nov 2, 2020

The solution in #802 doesn't work for me because I had to use bug fixes from latest commits.

I found this issue can be solved by commenting the sections in setup.py:

#        ext_modules.append(
#            CUDAExtension(name='mlp_cuda',
#                          sources=['csrc/mlp.cpp',
#                                   'csrc/mlp_cuda.cu'],
#                          extra_compile_args={'cxx': ['-O3'] + version_dependent_macros,
#                                              'nvcc':['-O3'] + version_dependent_macros}))

I think the problem is due to the use of Tensor::data_ptr<typename>() in csrc/mlp.cpp. This method is not supported in at least pytorch 1.2.

@FDecaYed Can this be solved, otherwise it's not officially supporting pytorch 1.2 as stated in project readme?

@FDecaYed
Copy link
Contributor

FDecaYed commented Nov 2, 2020

@hhaoyan Thanks for looking into the problem.
@ptrblck Shall we update readme for minimal pytorch version requirement?

@ptrblck
Copy link
Contributor

ptrblck commented Nov 2, 2020

Yes, we should update the readme to indicate the working versions.

@rosrad
Copy link

rosrad commented Nov 19, 2020

can we help to fix this issue.

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

7 participants