BachiLi / diffvg

Differentiable Vector Graphics Rasterization
https://people.csail.mit.edu/tzumao/diffvg/
Apache License 2.0
964 stars 159 forks source link

Can't build on ubuntu 18 #37

Open urimerhav opened 2 years ago

urimerhav commented 2 years ago

I followed the install procedure as outlined in the docs with python 3.7. On mac it just works. On a ubuntu 18 machine with gpu (CUDA Version: 11.0), it fails with the following logs. Are the "type traits" errors the reason for failure, or something else? Been bashing my head at this for hours now and not really making any progress.


-- pybind11 v2.6.0 dev
-- Using pybind11: (version "2.6.0" dev)
-- Build with CUDA support
INFO Building without TensorFlow support (not found)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/Code/diffvg/build/temp.linux-x86_64-3.7
[ 14%] Building NVCC (Device) object CMakeFiles/diffvg.dir/diffvg_generated_scene.cpp.o
[ 28%] Building NVCC (Device) object CMakeFiles/diffvg.dir/diffvg_generated_diffvg.cpp.o
/home/ubuntu/anaconda3/envs/pytorch_latest_p37/x86_64-conda-linux-gnu/include/c++/9.3.0/type_traits(148): error: "__or_v" is not a function or static data member

/home/ubuntu/anaconda3/envs/pytorch_latest_p37/x86_64-conda-linux-gnu/include/c++/9.3.0/type_traits(148): error: "constexpr" is not valid here

/home/ubuntu/anaconda3/envs/pytorch_latest_p37/x86_64-conda-linux-gnu/include/c++/9.3.0/type_traits(150): error: "__and_v" is not a function or static data member
... more of these warnings...
/home/ubuntu/anaconda3/envs/pytorch_latest_p37/x86_64-conda-linux-gnu/include/c++/9.3.0/type_traits(2885): error: "is_scalar_v" is not a function or static data member
    self.run_command('build_ext')
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 31, in run
    super().run()
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "setup.py", line 65, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status 2.
urimerhav commented 2 years ago

@BachiLi Trying to follow up on this. If you could point out any Amazon machine image or setup instructions for a GPU machine that works (what CUDA version, hardware, pytorch version etc) - I'd really appreciate it!

XiaoleiDi commented 2 years ago

I have same problem, cuda version 10.1 torch version 1.7.1 hardware amd R7-5800h RTX 3060 i tried to run CLIPasso at my computer with ubuntu 22.04 sorry about the grammar my English is not good

running install_lib
running build_py
running build_ext
-- pybind11 v2.6.0 dev
CMake Warning (dev) at /home/dxl/anaconda3/envs/CLP/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
...
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/home/dxl/anaconda3/envs/CLP/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status 2.
zhulifengsheng commented 2 years ago

I have same problem too. raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status 2.

fxcdl commented 1 year ago

I solved this problem on ubuntu20.04 cuda11.3 torch1.12.1 cmake3.22.1(it's important)

yudianzheng commented 1 year ago

For me, conda create -n diffvg python=3.7.5 tensorflow=1.15 , and the same as ubuntu20.04 cuda11.3 torch1.12.1.

LittleQBerry commented 1 year ago

same problem

yonhar commented 1 year ago

I solved the problem by downgrading gcc. It turns out that cmake build doesn't work well with versions later than 8. following this link I solved it by: sudo apt remove gcc sudo apt-get install gcc-7 g++-7 -y sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc sudo ln -s /usr/bin/g++-7 /usr/bin/g++ sudo ln -s /usr/bin/gcc-7 /usr/bin/cc sudo ln -s /usr/bin/g++-7 /usr/bin/c++

AnCoSONG commented 1 year ago

I solved this problem on ubuntu20.04 cuda11.3 torch1.12.1 cmake3.22.1(it's important)

My environment is a little different from yours(cuda11.6). In my case, I could run cmake --build ... script successfully in shell but the subprocess.check_call always return with 2. So I changed it to subprocess.call. Everything looks good so far.

fibarrola commented 1 year ago

I solved the problem by downgrading gcc. It turns out that cmake build doesn't work well with versions later than 8. following this link I solved it by: sudo apt remove gcc sudo apt-get install gcc-7 g++-7 -y sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc sudo ln -s /usr/bin/g++-7 /usr/bin/g++ sudo ln -s /usr/bin/gcc-7 /usr/bin/cc sudo ln -s /usr/bin/g++-7 /usr/bin/c++

This one allowed me to run in Ubuntu 22.04 by doing

sudo nano /etc/apt/sources.list

add the line: deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe

sudo apt update

and then doing your thing

yuchen-xiyue commented 1 year ago

I am using Ubuntu20.02(WSL2) + cuda12.2 and meet the same problem: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status 2. But I found there is no problem with cmake command. So I just simply tried: cmake --build . --config Debug -- -j8 Comment Line 65 in setup.py and then python setup.py install conda install -c conda-forge gcc=12.1.0 I successfully run the demos.

Yi-Lynn commented 8 months ago

I have same problem, cuda version 10.1 torch version 1.7.1 hardware amd R7-5800h RTX 3060 i tried to run CLIPasso at my computer with ubuntu 22.04 sorry about the grammar my English is not good

running install_lib
running build_py
running build_ext
-- pybind11 v2.6.0 dev
CMake Warning (dev) at /home/dxl/anaconda3/envs/CLP/share/cmake-3.22/Modules/CMakeDependentOption.cmake:84 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
...
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/home/dxl/anaconda3/envs/CLP/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status 2.

Hi, I am also running the CLIPasso project on Ubuntu 18.04 with cuda version 11.3 and torch version 1.11. Have you solved this problem? Thanks!

Yi-Lynn commented 8 months ago

I am also running the CLIPasso project on Ubuntu 18.04 with cuda version 11.3 and torch version 1.11

Just solved this problem using the solution from @yuchen-xiyue. Thanks a lot!

CrystalLiu1 commented 6 months ago

I solved this problem on ubuntu20.04 cuda11.3 torch1.12.1 cmake3.22.1(it's important)

My environment is a little different from yours(cuda11.6). In my case, I could run cmake --build ... script successfully in shell but the subprocess.check_call always return with 2. So I changed it to subprocess.call. Everything looks good so far.

Thank you very much, this is very useful to me.