Package Details: waifu2x-caffe v1.1.2-2

Git Clone URL: https://aur.archlinux.org/waifu2x-caffe.git (read-only, click to copy)
Package Base: waifu2x-caffe
Description: Image rescaling and noise reduction using the power of convolutional neural networks. Rewritten from the original Waifu2x using Caffe. Compiled with CUDA & cuDNN enabled flags.
Upstream URL: https://github.com/Gin-no-kami/waifu2x-caffe
Licenses: MIT
Conflicts: waifu2x-caffe
Provides: waifu2x-caffe
Submitter: ginnokami
Maintainer: ginnokami
Last Packager: ginnokami
Votes: 3
Popularity: 0.000046
First Submitted: 2021-04-18 23:44 (UTC)
Last Updated: 2024-02-28 01:12 (UTC)

Pinned Comments

ginnokami commented on 2021-04-18 23:47 (UTC)

This package provides the cli version of waifu2x-caffe. A readme for all of the flags is located in /usr/share/docs/waifu2x-caffe/README. The models are located at /usr/share/waifu2x-caffe/models.

Latest Comments

1 2 3 4 Next › Last »

ginnokami commented on 2024-03-31 12:01 (UTC)

@Ztumpie I am also getting a similar issue when building now. Caffe is not building due to one of the dependencies updating and I do not have the time/will to fix it as I have moved to using another upscaler. Happy to accept patches upstream at https://github.com/Gin-no-kami/caffe (the submodule that is currently failing to build).

Ztumpie commented on 2024-03-27 16:36 (UTC) (edited on 2024-03-27 16:36 (UTC) by Ztumpie)

It seems that build is failing. I wonder what would be the root cause of this problem. I have done yay -Syu before building.

This repeats every CXX file it builds

~/.cache/yay/waifu2x-caffe/src/waifu2x-caffe/caffe/include/caffe/util/cudnn.hpp:22:10: warning: enumeration value ‘CUDNN_STATUS_VERSION_MISMATCH’ not handled in switch [-Wswitch]
   22 |   switch (status) {

The fatal step was

[ 53%] Building CUDA object libcaffe/src/caffe/CMakeFiles/caffe.dir/layers/absval_layer.cu.o
/usr/include/absl/strings/str_cat.h: In function ‘std::enable_if_t<(sizeof... (T) > 1), typename std::common_type<typename std::conditional<true, void, absl::lts_20240116::strings_internal::EnableIfFastCase<T, typename std::enable_if<((std::is_arithmetic<T>::value && (! std::is_same<T, char>::value)) && (! std::is_same<T, bool>::value)), void>::type> >::type ...>::type> absl::lts_20240116::StrAppend(absl::Nonnull<T*>, T ...)’:
/usr/include/absl/strings/str_cat.h:606:316: error: expected ‘;’ before ‘...’ token
  606 |   for (const SomeTrivialEmptyType& dummy2 :
      |                                                                                                                                                                                                                                                                                                                            ^  
      |                                                                                                                                                                                                                                                                                                                            ;
/usr/include/absl/strings/str_cat.h:606:43: error: parameter packs not expanded with ‘...’:
  606 |   for (const SomeTrivialEmptyType& dummy2 :
      |                                           ^                                                                                                                                                                                                                                                                                     
/usr/include/absl/strings/str_cat.h:606:43: note:         ‘args’
make[2]: *** [libcaffe/src/caffe/CMakeFiles/caffe.dir/build.make:1575: libcaffe/src/caffe/CMakeFiles/caffe.dir/layers/absval_layer.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:449: libcaffe/src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: waifu2x-caffe-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
waifu2x-caffe - exit status 4

ginnokami commented on 2023-12-31 13:58 (UTC)

@gardotd426 Thanks for pointing this out. The issue is that cuda doesn't support gcc13.x yet. The version I just pushed successfully builds in a chroot.

gardotd426 commented on 2023-12-31 12:30 (UTC)

Build is failing (and has been for awhile), with:

5 errors detected in the compilation of "src/caffe/layers/accuracy_layer.cu".
make: *** [Makefile:606: .build_release/cuda/src/caffe/layers/accuracy_layer.o] Error 1
nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used
/usr/include/bits/floatn.h(86): error: invalid combination of type specifiers
  typedef __float128 _Float128;
                     ^

/usr/include/bits/floatn-common.h(214): error: invalid combination of type specifiers
  typedef float _Float32;
                ^

/usr/include/bits/floatn-common.h(251): error: invalid combination of type specifiers
  typedef double _Float64;
                 ^

/usr/include/bits/floatn-common.h(268): error: invalid combination of type specifiers
  typedef double _Float32x;
                 ^

/usr/include/bits/floatn-common.h(285): error: invalid combination of type specifiers
  typedef long double _Float64x;
                      ^

5 errors detected in the compilation of "src/caffe/layers/cudnn_softmax_layer.cu".
make: *** [Makefile:606: .build_release/cuda/src/caffe/layers/cudnn_softmax_layer.o] Error 1

And that's repeated like 100 times (I'm sure there may be minor variations each time, but it's hundreds of lines, they all have to do with compilation-bindir).

This warning appears several times during the build before it fails:

/opt/cuda/bin/nvcc -ccbin=g++ -Xcompiler -fPIC -DCAFFE_VERSION=1.0.0 -DNDEBUG -O2 -DUSE_CUDNN -DUSE_OPENCV -DUSE_LEVELDB -DUSE_LMDB -DUSE_HDF5 -I/usr/include/python3.5m -I/usr/lib/python3.5/dist-packages/numpy/core/include -I/usr/local/include -I/usr/include -I/usr/include/opencv4 -I.build_release/src -I./src -I./include -I/opt/cuda/include -gencode arch=compute_52,code=sm_52 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -c src/caffe/layers/cudnn_softmax_layer.cu -o .build_release/cuda/src/caffe/layers/cudnn_softmax_layer.o 2> .build_release/cuda/src/caffe/layers/cudnn_softmax_layer.o.warnings.txt \
    || (cat .build_release/cuda/src/caffe/layers/cudnn_softmax_layer.o.warnings.txt; exit 1)
nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used
/usr/include/bits/floatn.h(86): error: invalid combination of type specifiers
  typedef __float128 _Float128;

Neko-san commented on 2023-08-14 23:20 (UTC) (edited on 2023-08-14 23:20 (UTC) by Neko-san)

@ginnokami By using makepkg.conf, naturally (https://wiki.archlinux.org/title/Makepkg#Building_optimized_binaries) and by having Clang installed.

I build almost all packages with Clang.

ginnokami commented on 2023-08-14 23:16 (UTC) (edited on 2023-08-14 23:17 (UTC) by ginnokami)

@Neko-san No idea how you are getting clang into the chroot. This uses gcc to compile.

Neko-san commented on 2023-08-14 22:10 (UTC)

I can't get this to build for some reason, even in a chroot :/

-- The C compiler identification is Clang 15.0.7
-- The CXX compiler identification is Clang 15.0.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at caffe/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The CUDA compiler identification is NVIDIA 12.2.91
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /opt/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
CMake Warning (dev) at caffe/cmake/Misc.cmake:32 (set):
  implicitly converting 'BOOLEAN' to 'STRING' type.
Call Stack (most recent call first):
  caffe/CMakeLists.txt:33 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  /usr/lib/cmake/boost_thread-1.81.0/boost_thread-config.cmake:118 (find_dependency)
  /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake:141 (find_package)
  /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake:262 (boost_find_component)
  /usr/share/cmake/Modules/FindBoost.cmake:594 (find_package)
  caffe/cmake/Dependencies.cmake:8 (find_package)
  caffe/CMakeLists.txt:83 (include)


-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in prepare().
    Aborting...

ginnokami commented on 2023-07-30 20:39 (UTC)

@nx-que Thank you for the patch. I confirmed that it builds in a chroot and have updated it here.

nx-que commented on 2023-07-29 00:44 (UTC)

It seems there were quite a few breaking changes, here is a working PKGBUILD patch

diff --git a/PKGBUILD b/PKGBUILD
index 462777b..8a0c383 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,7 +24,7 @@ depends=(
 makedepends=(
     'git'
     'cmake'
-    'qt5-base'
+    'qt6-base'
 )
 optdepends=()
 provides=('waifu2x-caffe')
@@ -55,15 +55,20 @@ prepare() {
     cd "${srcdir}/waifu2x-caffe"
     git submodule update --init --recursive

-    # Change Source.cpp to update the model file location
-    sed -i 's+models/cunet+/usr/share/waifu2x-caffe/models/cunet+g' waifu2x-caffe/Source.cpp
-    
     # create symlink to caffe
     ln -sf ../caffe ./caffe
     ln -sf ../caffe ./libcaffe

+    # compile targets under C++17
+    sed -i 's~-std=c++14~-std=c++17~g' CMakeLists.txt
+    sed -i 's~-std=c++14~-std=c++17~g' caffe/Makefile.config
+    sed -i 's~-std=c++14~-std=c++17~g' caffe/Makefile.config.example
+
+    # Change Source.cpp to update the model file location
+    sed -i 's+models/cunet+/usr/share/waifu2x-caffe/models/cunet+g' waifu2x-caffe/Source.cpp
+
     cd ${srcdir}/build
-    cmake "${srcdir}/waifu2x-caffe" -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES  -gencode arch=compute_86,code=sm_86 "
+    cmake "${srcdir}/waifu2x-caffe" -DCMAKE_EXE_LINKER_FLAGS="-Wl,--copy-dt-needed-entries" -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--copy-dt-needed-entries" -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES  -gencode arch=compute_86,code=sm_86 "
     # Fix issue with the compile failing. These flags need to be removed from the CUDA_FLAGS, but I can't find which CMakeFile is generating this line. So just remove it with sed.
     sed -i 's/-Xcudafe --diag_suppress=set_but_not_used -DBOOST_ALL_NO_LIB;-DUSE_LMDB;-DUSE_LEVELDB;-DUSE_CUDNN;-DUSE_OPENCV;-DWITH_PYTHON_LAYER//g' libcaffe/src/caffe/CMakeFiles/caffe.dir/flags.make
 }

Bumped everything to C++17 (forced by other dependencies), libopencv_highgui requires qt6-base libraries now and applied (temporary) workaround for linker failure around this protobuf issue until it's fixed upstream.
Note that missing headers for cblas is still an issue, when blas-openblas is installed.