NVIDIA / flownet2-pytorch

Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
Other
3.12k stars 739 forks source link

Error when building CUDA kernels with PyTorch 1.6.0 #227

Closed rakeshjasti closed 4 years ago

rakeshjasti commented 4 years ago

I'm unable to build the CUDA kernels for channelnorm, resample2d, correlation when using PyTorch >= 1.5.1. However, I'm able to successfully build them with PyTorch <= 1.4.0. Is there a way to make this work since I need to use PyTorch >= 1.5.1?

ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/rakesh/software/miniconda2/envs/cu101torch151s2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1423, in _run_ninja_build
    check=True)
  File "/home/rakesh/software/miniconda2/envs/cu101torch151s2/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 32, in <module>
    'build_ext': BuildExtension
  File "/home/rakesh/software/miniconda2/envs/cu101torch151s2/lib/python3.6/site-packages/setuptools/__init__.py", line 163, in setup
    return distutils.core.setup(**attrs)

.
.
.
.

  File "/home/rakesh/software/miniconda2/envs/cu101torch151s2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1163, in _write_ninja_file_and_compile_objects
    error_prefix='Error compiling objects for extension')
  File "/home/rakesh/software/miniconda2/envs/cu101torch151s2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1436, in _run_ninja_build
    raise RuntimeError(message)
RuntimeError: Error compiling objects for extension
andrewjong commented 4 years ago

@rakeshjasti how did you resolve the issue?

rakeshjasti commented 4 years ago

Replace Line 8 with cxx_args = ['-std=c++14']. Making this change in all the setup.py files should fix the issues.

LiUzHiAn commented 4 years ago

rakeshjasti's solution works well with CUDA 10.1 and Pytorch 1.5.1. Thanks

ra1995 commented 4 years ago

@rakeshjasti Thanks a lot for the solution, works for python 3.7, pytorch 1.6.0

ljp1997 commented 3 years ago

@rakeshjasti Thank you very much!Your solution works well with CUDA11.0,pytorch 1.7.0.

Philip-AH commented 3 years ago

@rakeshjasti Thanks a lot. Works with python 3.5, Cuda 10.2 and PyTorch 1.5.0.

ShuhongChen commented 3 years ago

@rakeshjasti thanks, also works w/ python 3.8.8, cuda 11.1, pytorch 1.8.0

zzzolo commented 2 years ago

@rakeshjasti Thanks a lot. It works for cuda10.1 pytorch 1.8.0.

jingyang2017 commented 2 years ago

@rakeshjasti Thanks a lot. It works for cuda10.2 pytorch 1.10.1.

donaghyXu commented 2 years ago

@rakeshjasti Thanks a lot. Works with python 3.7, Cuda 10.2 and PyTorch 1.5.0.

CARASO commented 2 years ago

error: unrecognized command line option ‘-std=c++14’

ra1995 commented 2 years ago

error: unrecognized command line option ‘-std=c++14’

Your compiler needs to support c++14. You are maybe on an older compiler version

GaEunKim-study commented 2 years ago

@rakeshjasti Thanks a lot. Works with python 3.7, Cuda 10.2 and PyTorch 1.5.0.

Hello I'm doing it in the same environment, but there's an environmental error. my environment is: torch 1.5.0, cuda 10.2, python 3.7. The error is as follows: RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

cudnn uses 7.6.5, how much did you use for version of cudnn? Didn't you get this error?

Maxxiaoshuai commented 1 year ago

@rakeshjasti Thanks a lot for the solution, works for python 3.6.13, pytorch 1.10.2, cuda 11.3.

piddnad commented 1 year ago

@rakeshjasti Thanks a lot for the solution, works for python 3.8.13, pytorch 1.7.1, cuda 11.0.

fbragman commented 1 year ago

@rakeshjasti Installed fine with python 3.8.13, pytorch 1.10.1, cuda 11.3

nik1806 commented 11 months ago

Thanks, installation worked with python 3.9.13, cuda 11.6 and python 1.13.1

stha-prashant commented 5 months ago

Thanks, installation worked with python 3.9.13, cuda 11.6 and python 1.13.1

hi were you able to install flownet with these versions?