Samiepapa / DECA

DECA: Detailed Expression Capture and Animation (SIGGRAPH 2021)
Other
0 stars 0 forks source link

Build Failed : Error building extension 'standard_rasterize_cuda' #2

Open Samiepapa opened 2 years ago

Samiepapa commented 2 years ago
$ python demos/demo_reconstruct.py -i TestSamples/examples/ --saveDepth True --saveObj True
Downloading: "https://www.adrianbulat.com/downloads/python-fan/2DFAN4-cd938726ad.zip" to /home/yongilcho/.cache/torch/hub/checkpoints/2DFAN4-cd938726ad.zip
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 91.9M/91.9M [00:52<00:00, 1.83MB/s]
creating the FLAME Decoder
trained model found. load /home/yongilcho/reposit/DECA/data/deca_model.tar
/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
  warnings.warn(
Traceback (most recent call last):
  File "/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1717, in _run_ninja_build
    subprocess.run(
  File "/home/yongilcho/anaconda3/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "demos/demo_reconstruct.py", line 130, in <module>
    main(parser.parse_args())
  File "demos/demo_reconstruct.py", line 49, in main
    deca = DECA(config = deca_cfg, device=device)
  File "/home/yongilcho/reposit/DECA/decalib/deca.py", line 50, in __init__
    self._setup_renderer(self.cfg.model)
  File "/home/yongilcho/reposit/DECA/decalib/deca.py", line 53, in _setup_renderer
    set_rasterizer(self.cfg.rasterizer_type)
  File "/home/yongilcho/reposit/DECA/decalib/utils/renderer.py", line 39, in set_rasterizer
    load(name='standard_rasterize_cuda',
  File "/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1124, in load
    return _jit_compile(
  File "/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1337, in _jit_compile
    _write_ninja_file_and_build_library(
  File "/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1449, in _write_ninja_file_and_build_library
    _run_ninja_build(
  File "/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1733, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error building extension 'standard_rasterize_cuda': [1/3] /usr/local/cuda/bin/nvcc  -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/TH -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/yongilcho/anaconda3/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -ccbin=$(which gcc-7) -c /home/yongilcho/reposit/DECA/decalib/utils/rasterizer/standard_rasterize_cuda_kernel.cu -o standard_rasterize_cuda_kernel.cuda.o
FAILED: standard_rasterize_cuda_kernel.cuda.o
/usr/local/cuda/bin/nvcc  -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/TH -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/yongilcho/anaconda3/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --compiler-options '-fPIC' -std=c++14 -ccbin=$(which gcc-7) -c /home/yongilcho/reposit/DECA/decalib/utils/rasterizer/standard_rasterize_cuda_kernel.cu -o standard_rasterize_cuda_kernel.cuda.o
-c: No such file or directory
nvcc fatal   : Failed to preprocess host compiler properties.
[2/3] c++ -MMD -MF standard_rasterize_cuda.o.d -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/TH -isystem /home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/yongilcho/anaconda3/include/python3.8 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -c /home/yongilcho/reposit/DECA/decalib/utils/rasterizer/standard_rasterize_cuda.cpp -o standard_rasterize_cuda.o
ninja: build stopped: subcommand failed.
Samiepapa commented 2 years ago

Readme에 적힌 에러 발생

For visualization, we use our rasterizer that uses pytorch JIT Compiling Extensions. If there occurs a compiling error, you can install pytorch3d instead and set --rasterizer_type=pytorch3d when running the demos.

1) 해결하기 위해 아래와 같이 pytorch3d 설치한다.

$ pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1100/download.html

2) 설치하고 나서 아래와 같이 빌드 옵션 추가해서 빌드한다.

$ python demos/demo_reconstruct.py -i TestSamples/examples/ --saveDepth True --saveObj True --rasterizer_type=pytorch3d
creating the FLAME Decoder
trained model found. load /home/yongilcho/reposit/DECA/data/deca_model.tar
/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/pytorch3d/io/obj_io.py:533: UserWarning: Mtl file does not exist: /home/yongilcho/reposit/DECA/data/template.mtl
  warnings.warn(f"Mtl file does not exist: {f}")
  0%|                                                                                                                                                                  | 0/9 [00:00<?, ?it/s]/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/nn/functional.py:3631: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  warnings.warn(
/home/yongilcho/.virtualenvs/DECA/lib/python3.8/site-packages/torch/nn/functional.py:4003: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.
  warnings.warn(
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:11<00:00,  1.27s/it]
-- please check the results in TestSamples/examples/results

성공?