Package Details: vapoursynth-plugin-fsrcnn-ncnn-vulkan-git r3.c9dad37-2

Git Clone URL: https://aur.archlinux.org/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git.git (read-only, click to copy)
Package Base: vapoursynth-plugin-fsrcnn-ncnn-vulkan-git
Description: Plugin for Vapoursynth: fsrcnn-ncnn-vulkan (GIT version)
Upstream URL: https://github.com/Sg4Dylan/vapoursynth-fsrcnn-ncnn-vulkan
Keywords: vapoursynth
Licenses: MIT
Conflicts: vapoursynth-plugin-fsrcnn-ncnn-vulkan
Provides: vapoursynth-plugin-fsrcnn-ncnn-vulkan
Submitter: sl1pkn07
Maintainer: sl1pkn07
Last Packager: sl1pkn07
Votes: 0
Popularity: 0.000000
First Submitted: 2020-02-29 14:41 (UTC)
Last Updated: 2023-11-04 15:34 (UTC)

Latest Comments

Win8Error commented on 2021-10-25 18:29 (UTC)

Hello, sadly also this package fails to build.

i have currently a Intel i7 8750H and a GTX 1050M MaxQ.

-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/build
[ 33%] Building C object CMakeFiles/vs_fsrcnn_vulkan.dir/main.c.o
[ 66%] Building CXX object CMakeFiles/vs_fsrcnn_vulkan.dir/fsrcnn.cpp.o
/home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp: In function 'void new_to_gray(const ncnn::Mat&, float*)':
/home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:136:29: error: 'max' was not declared in this scope
  136 |                 *gray = min(max(*ptr, 0), 255);
      |                             ^~~
/home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:136:29: note: suggested alternatives:
In file included from /usr/include/c++/11.1.0/algorithm:62,
                 from /usr/include/opencv4/opencv2/core/base.hpp:55,
                 from /usr/include/opencv4/opencv2/core.hpp:53,
                 from /home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:9:
/usr/include/c++/11.1.0/bits/stl_algo.h:3467:5: note:   'std::max'
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
In file included from /home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:9:
/usr/include/opencv4/opencv2/core.hpp:1467:17: note:   'cv::max'
 1467 | CV_EXPORTS void max(const UMat& src1, const UMat& src2, UMat& dst);
      |                 ^~~
/home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:136:25: error: 'min' was not declared in this scope
  136 |                 *gray = min(max(*ptr, 0), 255);
      |                         ^~~
/home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:136:25: note: suggested alternatives:
In file included from /usr/include/c++/11.1.0/algorithm:62,
                 from /usr/include/opencv4/opencv2/core/base.hpp:55,
                 from /usr/include/opencv4/opencv2/core.hpp:53,
                 from /home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:9:
/usr/include/c++/11.1.0/bits/stl_algo.h:3455:5: note:   'std::min'
 3455 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
In file included from /home/yuki/Schreibtisch/vs_plugins/_git/vapoursynth-plugin-fsrcnn-ncnn-vulkan-git/src/fsrcnn-ncnn-vulkan/fsrcnn.cpp:9:
/usr/include/opencv4/opencv2/core.hpp:1446:17: note:   'cv::min'
 1446 | CV_EXPORTS void min(const UMat& src1, const UMat& src2, UMat& dst);
      |                 ^~~
make[2]: *** [CMakeFiles/vs_fsrcnn_vulkan.dir/build.make:90: CMakeFiles/vs_fsrcnn_vulkan.dir/fsrcnn.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/vs_fsrcnn_vulkan.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
==> FEHLER: Ein Fehler geschah in build().
    Breche ab...

Win8Error commented on 2021-08-28 20:18 (UTC)

Build fails with following output:

==> Retrieving sources...
  -> Found esee.patch
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Creating working copy of fsrcnn-ncnn-vulkan git repo...
Cloning into 'fsrcnn-ncnn-vulkan'...
done.
==> Starting prepare()...
(Stripping trailing CRs from patch; use --binary to disable.)
patching file fsrcnn.cpp
Hunk #1 FAILED at 24 (different line endings).
Hunk #2 FAILED at 36 (different line endings).
Hunk #3 FAILED at 140 (different line endings).
Hunk #4 FAILED at 155 (different line endings).
4 out of 4 hunks FAILED -- saving rejects to file fsrcnn.cpp.rej
==> ERROR: A failure occurred in prepare().
    Aborting...
==> ERROR: Build failed, check /home/.archbuild/extra-x86_64/yuki/build

sl1pkn07 commented on 2021-07-03 19:06 (UTC)

Hello. the first part of the patch is done in the pkgbuild with sed. the last one (from the define min/max) seems need include in upstream?

can you sen a PR to the project?

greetings

sandsmark commented on 2021-07-03 17:52 (UTC)

I need something like this to get it to work:

diff --git CMakeLists.txt CMakeLists.txt
  index c4d3296..3ddb873 100644
  --- CMakeLists.txt
  +++ CMakeLists.txt
  @@ -2,28 +2,28 @@ project(vs_fsrcnn_vulkan)

   cmake_minimum_required(VERSION 3.1)

  -set(CMAKE_BUILD_TYPE Release)
  +set(CMAKE_BUILD_TYPE Debug)
   include_directories(${CMAKE_CURRENT_SOURCE_DIR})

  -set(OpenCV "D:/ProgramData/opencv/build")
  -include_directories(${OpenCV}/include)
  -link_directories(${OpenCV}/x64/vc15/lib)
  +set(OpenCV "/usr")
  +include_directories(${OpenCV}/include/opencv4)
  +link_directories(${OpenCV}/lib)

  -set(Vulkan "D:/ProgramData/VulkanSDK/1.1.126.0")
  -include_directories(${Vulkan}/Include)
  -link_directories(${Vulkan}/Lib)
  +set(Vulkan "/usr")
  +include_directories(${Vulkan}/include)
  +link_directories(${Vulkan}/lib)

  -set(NCNN_Build "D:/Workspace/ncnn-master/build-vs2017/install")
  +set(NCNN_Build "/usr")
   include_directories(${NCNN_Build}/include/ncnn)
   link_directories(${NCNN_Build}/lib)

  -set(VapourSynthSDK "D:/Program Files/VapourSynth/sdk")
  +set(VapourSynthSDK "/usr")
   include_directories(${VapourSynthSDK}/include/vapoursynth)
  -link_directories(${VapourSynthSDK}/lib64)
  +link_directories(${VapourSynthSDK}/lib)

   add_library(vs_fsrcnn_vulkan SHARED main.c fsrcnn.cpp)
   target_link_libraries(vs_fsrcnn_vulkan vapoursynth)
  -target_link_libraries(vs_fsrcnn_vulkan vsscript)
  -target_link_libraries(vs_fsrcnn_vulkan opencv_world412)
  -target_link_libraries(vs_fsrcnn_vulkan vulkan-1)
  +target_link_libraries(vs_fsrcnn_vulkan vapoursynth-script)
  +target_link_libraries(vs_fsrcnn_vulkan opencv_core opencv_imgproc opencv_highgui)
  +target_link_libraries(vs_fsrcnn_vulkan vulkan glslang SPIRV)
   target_link_libraries(vs_fsrcnn_vulkan ncnn)
  diff --git fsrcnn.cpp fsrcnn.cpp
  index 77686df..019b612 100644
  --- fsrcnn.cpp
  +++ fsrcnn.cpp
  @@ -24,10 +24,18 @@
   #include "fsrcnn.h"

   ncnn::Net fsrcnn;
  +#ifndef min
  +#define min(a,b) ((a) <= (b) ? (a) : (b))
  +#endif
  +#ifndef max
  +#define max(a,b) ((a) >= (b) ? (a) : (b))
  +#endif

   void fsrcnn_process(cv::Mat&, cv::Mat&, int, int);
  +static ncnn::PoolAllocator *pa;

   void init_ncnn() {
  +    pa = new ncnn::PoolAllocator;
          ncnn::create_gpu_instance();
          fsrcnn.set_vulkan_device(0);
          fsrcnn.opt.use_vulkan_compute = true;
  @@ -36,6 +44,8 @@ void init_ncnn() {
   }

   void destroy_ncnn() {
  +    delete pa;
  +    pa = nullptr;
          fsrcnn.clear();
          ncnn::destroy_gpu_instance();
   }
  @@ -140,12 +150,15 @@ void new_to_gray(const ncnn::Mat& m, float* gray)
   }

   void fsrcnn_process(cv::Mat& img_y, cv::Mat& out_y, int w, int h) {
  +        ncnn::VkAllocator* blob_vkallocator = fsrcnn.vulkan_device()->acquire_blob_allocator();
          ncnn::VkMat in_gpu;
  +        in_gpu.allocator = blob_vkallocator;
          ncnn::VkMat out_gpu;
  +        out_gpu.allocator = blob_vkallocator;
          ncnn::Mat inimage = in_gpu.mapped();
          ncnn::Mat outimage = out_gpu.mapped();

  -       new_from_gray((float *)img_y.data, w, h, inimage, (ncnn::Allocator*)0);
  +       new_from_gray((float *)img_y.data, w, h, inimage, pa);

          {
                  ncnn::Extractor ex = fsrcnn.create_extractor();
  @@ -155,4 +168,5 @@ void fsrcnn_process(cv::Mat& img_y, cv::Mat& out_y, int w, int h) {
          }

          new_to_gray(outimage, (float*)out_y.data);
  +        fsrcnn.vulkan_device()->reclaim_blob_allocator(blob_vkallocator);
   }