Skip to content

Commit

Permalink
MFH: r544526
Browse files Browse the repository at this point in the history
graphics/waifu2x-ncnn-vulkan: back out r539374

ncnn API is not stable, updates frequently break this port.
Binary is also smaller when using bundled ncnn.

 $ size $(which waifu2x-ncnn-vulkan)
    text    data     bss     dec     hex filename
-7245567  242384   58992 7546943  73283f /usr/local/bin/waifu2x-ncnn-vulkan
+3281223    3152   58840 3343215  33036f /usr/local/bin/waifu2x-ncnn-vulkan

$ waifu2x-ncnn-vulkan -i foo.png -o bar.png
[0 Intel(R) HD Graphics 530 (SKL GT2)]  queueC=0[1]  queueG=0[1]  queueT=0[1]
[0 Intel(R) HD Graphics 530 (SKL GT2)]  bugsbn1=0  buglbia=0  bugcopc=0  bugihfa=0
[0 Intel(R) HD Graphics 530 (SKL GT2)]  fp16p=1  fp16s=1  fp16a=1  int8s=1  int8a=1
pipeline specialization count mismatch, expect 4 but got 1
new_pipeline failed
pipeline specialization count mismatch, expect 4 but got 1
new_pipeline failed
Process 8606 stopped
* thread #14, name = 'waifu2x-ncnn-vul', stop reason = signal SIGSEGV: invalid address (fault address: 0x28)
    frame #0: 0x0000000802080be9 libvulkan_intel.so`anv_CmdPushDescriptorSetWithTemplateKHR(commandBuffer=0x000000080c432800, descriptorUpdateTemplate=0x0000000000000000, _layout=0x0000000000000000, _set=0, pData=0x000000080c440140) at anv_cmd_buffer.c:1372:69
   1369
   1370    assert(_set < MAX_PUSH_DESCRIPTORS);
   1371
-> 1372    struct anv_descriptor_set_layout *set_layout = layout->set[_set].layout;
   1373
   1374    struct anv_descriptor_set *set =
   1375       anv_cmd_buffer_push_descriptor_set(cmd_buffer, template->bind_point,
(lldb) bt
* thread #14, name = 'waifu2x-ncnn-vul', stop reason = signal SIGSEGV: invalid address (fault address: 0x28)
  * frame #0: 0x0000000802080be9 libvulkan_intel.so`anv_CmdPushDescriptorSetWithTemplateKHR(commandBuffer=0x000000080c432800, descriptorUpdateTemplate=0x0000000000000000, _layout=0x0000000000000000, _set=0, pData=0x000000080c440140) at anv_cmd_buffer.c:1372:69
    frame #1: 0x00000000004facce waifu2x-ncnn-vulkan`ncnn::VkCompute::record_pipeline(this=<unavailable>, pipeline=0x00000008045e3400, buffer_bindings=0x00007fffc35ea418, image_bindings=0x00007fffc35ea0f0, constants=0x00007fffc35ea400, dispatcher=0x00007fffc35ea110) at command.cpp:1457:13
    frame #2: 0x00000000004f981c waifu2x-ncnn-vulkan`ncnn::VkCompute::record_pipeline(ncnn::Pipeline const*, std::__1::vector<ncnn::VkMat, std::__1::allocator<ncnn::VkMat> > const&, std::__1::vector<ncnn::vk_constant_type, std::__1::allocator<ncnn::vk_constant_type> > const&, ncnn::VkMat const&) [inlined] ncnn::VkCompute::record_pipeline(this=<unavailable>, pipeline=<unavailable>, buffer_bindings=<unavailable>, image_bindings=0x00007fffc35ea0f0, constants=<unavailable>, dispatcher=<unavailable>) at command.cpp:1187:5
    frame #3: 0x00000000004f97bb waifu2x-ncnn-vulkan`ncnn::VkCompute::record_pipeline(this=<unavailable>, pipeline=<unavailable>, bindings=<unavailable>, constants=<unavailable>, dispatcher=<unavailable>) at command.cpp:1175
    frame #4: 0x000000000086b516 waifu2x-ncnn-vulkan`Waifu2x::process(this=0x00007fffffffdd58, inimage=0x00007fffc35eaf30, outimage=0x00007fffc35eaf70) const at waifu2x.cpp:457:25
    frame #5: 0x000000000084cd45 waifu2x-ncnn-vulkan`proc(args=0x00007fffffffdb70) at main.cpp:281:18
    frame #6: 0x00000008008fd1c9 libthr.so.3`thread_start(curthread=0x0000000807874300) at thr_create.c:292:16

Approved by:	ports-secteam blanket
  • Loading branch information
jbeich committed Aug 8, 2020
1 parent 41a7a71 commit 138464f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 4 additions & 12 deletions graphics/waifu2x-ncnn-vulkan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PORTNAME= waifu2x-ncnn-vulkan
DISTVERSION= 20200606
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= graphics

MAINTAINER= jbeich@FreeBSD.org
Expand All @@ -12,17 +12,16 @@ LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= glslangValidator:devel/glslang \
vulkan-headers>0:devel/vulkan-headers \
${LOCALBASE}/lib/libncnn.a:misc/ncnn
vulkan-headers>0:devel/vulkan-headers
LIB_DEPENDS= libwebp.so:graphics/webp \
libvulkan.so:graphics/vulkan-loader

USES= cmake compiler:${OPENMP}c++11-lib localbase:ldflags
USE_GITHUB= yes
GH_ACCOUNT= nihui
GH_TUPLE= KhronosGroup:glslang:8.13.3743-39-gd39b8afc:glslang/src/ncnn/glslang \
Tencent:ncnn:20200413-97-g13c59d9:ncnn/src/ncnn
CMAKE_SOURCE_PATH= ${WRKSRC}/src
CFLAGS+= -isystem${LOCALBASE}/include/ncnn
LDFLAGS+= -lglslang -lHLSL -lOSDependent -lOGLCompiler -lSPIRV -lpthread # from ncnn
PLIST_FILES= bin/${PORTNAME}
PORTDATA= *

Expand All @@ -31,15 +30,8 @@ PORTDATA= *
OPENMP= gcc-
.endif

pre-configure:
@if ${GREP} -q 'NCNN_VULKAN 0' ${LOCALBASE}/include/ncnn/platform.h; then \
${ECHO_MSG} "${PKGBASE} requires ncnn built with VULKAN option enabled."; \
return 1; \
fi

post-extract:
@${ECHO_CMD} >${WRKSRC}/src/libwebp/CMakeLists.txt
@${ECHO_CMD} >${WRKSRC}/src/ncnn/CMakeLists.txt

post-patch:
@${REINPLACE_CMD} -e '/PATHSTR/s,models-,${DATADIR}/&,' \
Expand Down
4 changes: 4 additions & 0 deletions graphics/waifu2x-ncnn-vulkan/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
TIMESTAMP = 1591444867
SHA256 (nihui-waifu2x-ncnn-vulkan-20200606_GH0.tar.gz) = 744a71279dd670eae432dad345302ef1e197cb6f64099a5a937ca545647d5afd
SIZE (nihui-waifu2x-ncnn-vulkan-20200606_GH0.tar.gz) = 34067785
SHA256 (KhronosGroup-glslang-8.13.3743-39-gd39b8afc_GH0.tar.gz) = 5785e8d5fc2f77a1b0643910480c76fc049bc3e7592c6cd9df7fc8c1864af344
SIZE (KhronosGroup-glslang-8.13.3743-39-gd39b8afc_GH0.tar.gz) = 3203976
SHA256 (Tencent-ncnn-20200413-97-g13c59d9_GH0.tar.gz) = b336a04546f148928b7507155c1e3db829a1ec93e062e2d44f158c685ccfae53
SIZE (Tencent-ncnn-20200413-97-g13c59d9_GH0.tar.gz) = 10606993

0 comments on commit 138464f

Please sign in to comment.