nihui / waifu2x-ncnn-vulkan

waifu2x converter ncnn version, runs fast on intel / amd / nvidia / apple-silicon GPU with vulkan
MIT License
2.99k stars 205 forks source link

Segmentation error on 4x upscale with RX 5500 #154

Closed bortox closed 3 years ago

bortox commented 3 years ago

Hi, sorry if this is a dumb question.

Running endeavour-os with vulkan-radeon and waifu2x-ncnn-vulkan-bin

I'm trying to upscale 4x a folder of 900x1280 .jpg.

Everytime I start the command with 4x upscale vram usage jumps from 1GB to 2.75GB and it upscales a couple of images ( 1-3 ) from 900x1280 to 3600x5120 before throwing error. With -s 2 no problem but -s 4 error. How could I make it run without errors?

waifu2x-ncnn-vulkan -i $HOME/Scaricati/TEST/T1/ -o $HOME/Scaricati/TEST/T4/ -m /usr/share/waifu2x-ncnn-vulkan/models-upconv_7_anime_style_art_rgb/ -s 4 -g=1
[0 Radeon RX 5500 XT]  queueC=1[4]  queueG=0[1]  queueT=2[2]
[0 Radeon RX 5500 XT]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[0 Radeon RX 5500 XT]  fp16-p/s/a=1/1/1  int8-p/s/a=1/1/1
[0 Radeon RX 5500 XT]  subgroup=64  basic=1  vote=1  ballot=1  shuffle=1
/usr/bin/waifu2x-ncnn-vulkan: riga 31: 71257 Errore di segmentazione (core dump creato) /usr/share/waifu2x-ncnn-vulkan/waifu2x-ncnn-vulkan $args

Log

mag 24 14:15:02 linux-endeavour audit[71470]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=4 pid=71470 comm="waifu2x-ncnn-vu" exe="/usr/share/waifu2x-ncnn-vulkan/waifu2x-ncnn-vulkan" sig=11 res=1
mag 24 14:15:02 linux-endeavour kernel: waifu2x-ncnn-vu[71493]: segfault at 7f94256fd010 ip 0000000000438cfd sp 00007f945eff4a60 error 6 in waifu2x-ncnn-vulkan[400000+3af000]
mag 24 14:15:02 linux-endeavour kernel: Code: 48 39 c7 74 05 e8 c3 c9 fc ff 48 8b 84 24 00 02 00 00 48 85 c0 74 06 f0 83 28 01 74 52 48 8b 84 24 c0 01 00 00 48 85 c0 74 06 <f0> 83 28 01 74 60 48 8b 44 24 28 48 8b bc 24 98 01 00 00 48 83 c0
mag 24 14:15:02 linux-endeavour kernel: audit: type=1701 audit(1621858502.666:451): auid=1000 uid=1000 gid=1000 ses=4 pid=71470 comm="waifu2x-ncnn-vu" exe="/usr/share/waifu2x-ncnn-vulkan/waifu2x-ncnn-vulkan" sig=11 res=1
mag 24 14:15:02 linux-endeavour audit: BPF prog-id=106 op=LOAD
mag 24 14:15:02 linux-endeavour audit: BPF prog-id=107 op=LOAD
mag 24 14:15:02 linux-endeavour audit: BPF prog-id=108 op=LOAD
mag 24 14:15:02 linux-endeavour kernel: audit: type=1334 audit(1621858502.676:452): prog-id=106 op=LOAD
mag 24 14:15:02 linux-endeavour kernel: audit: type=1334 audit(1621858502.676:453): prog-id=107 op=LOAD
mag 24 14:15:02 linux-endeavour kernel: audit: type=1334 audit(1621858502.676:454): prog-id=108 op=LOAD
mag 24 14:15:02 linux-endeavour systemd[1]: Started Process Core Dump (PID 71718/UID 0).
mag 24 14:15:02 linux-endeavour kernel: audit: type=1130 audit(1621858502.677:455): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-71718-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mag 24 14:15:02 linux-endeavour audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-71718-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mag 24 14:15:05 linux-endeavour systemd-coredump[71719]: Process 71470 (waifu2x-ncnn-vu) of user 1000 dumped core.

                                                         Stack trace of thread 71493:
                                                         #0  0x0000000000438cfd n/a (waifu2x-ncnn-vulkan + 0x38cfd)
                                                         #1  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #2  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71479:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71473:
                                                         #0  0x00007f948c90c8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                                                         #1  0x00007f948c906270 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf270)
                                                         #2  0x00007f948bec90bc n/a (libvulkan_radeon.so + 0x1f30bc)
                                                         #3  0x00007f948bec8958 n/a (libvulkan_radeon.so + 0x1f2958)
                                                         #4  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #5  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71470:
                                                         #0  0x00007f948c90c8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                                                         #1  0x00007f948c901743 __pthread_clockjoin_ex (libpthread.so.0 + 0xa743)
                                                         #2  0x0000000000411aaf n/a (waifu2x-ncnn-vulkan + 0x11aaf)
                                                         #3  0x00007f948c9e4b25 __libc_start_main (libc.so.6 + 0x27b25)
                                                         #4  0x0000000000412d39 n/a (waifu2x-ncnn-vulkan + 0x12d39)

                                                         Stack trace of thread 71476:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71478:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71485:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71474:
                                                         #0  0x00007f948c90c8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                                                         #1  0x00007f948c906270 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf270)
                                                         #2  0x00007f948bec90bc n/a (libvulkan_radeon.so + 0x1f30bc)
                                                         #3  0x00007f948bec8958 n/a (libvulkan_radeon.so + 0x1f2958)
                                                         #4  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #5  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71482:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71480:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71481:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71472:
                                                         #0  0x00007f948c90c8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                                                         #1  0x00007f948c906270 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf270)
                                                         #2  0x00007f948bec90bc n/a (libvulkan_radeon.so + 0x1f30bc)
                                                         #3  0x00007f948bec8958 n/a (libvulkan_radeon.so + 0x1f2958)
                                                         #4  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #5  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71471:
                                                         #0  0x00007f948c90c8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                                                         #1  0x00007f948c906270 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf270)
                                                         #2  0x00007f948bec90bc n/a (libvulkan_radeon.so + 0x1f30bc)
                                                         #3  0x00007f948bec8958 n/a (libvulkan_radeon.so + 0x1f2958)
                                                         #4  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #5  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71477:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71484:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71489:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71486:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71494:
                                                         #0  0x00007f948c90c8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                                                         #1  0x00007f948c906270 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf270)
                                                         #2  0x0000000000438893 n/a (waifu2x-ncnn-vulkan + 0x38893)
                                                         #3  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #4  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71483:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71487:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71475:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71491:
                                                         #0  0x00007f948cab259b ioctl (libc.so.6 + 0xf559b)
                                                         #1  0x00007f948607db49 drmIoctl (libdrm.so.2 + 0x6b49)
                                                         #2  0x00007f9486081cc5 drmSyncobjWait (libdrm.so.2 + 0xacc5)
                                                         #3  0x00007f9480b8003e n/a (amdvlk64.so + 0x51f03e)
                                                         #4  0x00007f94809a3faf n/a (amdvlk64.so + 0x342faf)
                                                         #5  0x000000000042681e n/a (waifu2x-ncnn-vulkan + 0x2681e)
                                                         #6  0x00000000005ad7a3 n/a (waifu2x-ncnn-vulkan + 0x1ad7a3)
                                                         #7  0x000000000043bb96 n/a (waifu2x-ncnn-vulkan + 0x3bb96)
                                                         #8  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #9  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71488:
                                                         #0  0x00007f948c93701e futex_wait (libgomp.so.1 + 0x1f01e)
                                                         #1  0x00007f948c9346a0 gomp_simple_barrier_wait (libgomp.so.1 + 0x1c6a0)
                                                         #2  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #3  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71490:
                                                         #0  0x00007f948c90c8ca __futex_abstimed_wait_common64 (libpthread.so.0 + 0x158ca)
                                                         #1  0x00007f948c906270 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf270)
                                                         #2  0x00000000004296f3 n/a (waifu2x-ncnn-vulkan + 0x296f3)
                                                         #3  0x00007f948c92bc06 GOMP_parallel (libgomp.so.1 + 0x13c06)
                                                         #4  0x000000000041db02 n/a (waifu2x-ncnn-vulkan + 0x1db02)
                                                         #5  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #6  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)

                                                         Stack trace of thread 71492:
                                                         #0  0x00007f948cab259b ioctl (libc.so.6 + 0xf559b)
                                                         #1  0x00007f948607db49 drmIoctl (libdrm.so.2 + 0x6b49)
                                                         #2  0x00007f9486081cc5 drmSyncobjWait (libdrm.so.2 + 0xacc5)
                                                         #3  0x00007f9480b8003e n/a (amdvlk64.so + 0x51f03e)
                                                         #4  0x00007f94809a3faf n/a (amdvlk64.so + 0x342faf)
                                                         #5  0x000000000042681e n/a (waifu2x-ncnn-vulkan + 0x2681e)
                                                         #6  0x00000000005ad7a3 n/a (waifu2x-ncnn-vulkan + 0x1ad7a3)
                                                         #7  0x000000000043bb96 n/a (waifu2x-ncnn-vulkan + 0x3bb96)
                                                         #8  0x00007f948c900259 start_thread (libpthread.so.0 + 0x9259)
                                                         #9  0x00007f948cabb5e3 __clone (libc.so.6 + 0xfe5e3)
mag 24 14:15:05 linux-endeavour systemd[1]: systemd-coredump@13-71718-0.service: Deactivated successfully.
mag 24 14:15:05 linux-endeavour kernel: audit: type=1131 audit(1621858505.156:456): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-71718-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mag 24 14:15:05 linux-endeavour audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@13-71718-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
mag 24 14:15:05 linux-endeavour systemd[1]: systemd-coredump@13-71718-0.service: Consumed 2.408s CPU time.
mag 24 14:15:05 linux-endeavour audit: BPF prog-id=108 op=UNLOAD
mag 24 14:15:05 linux-endeavour audit: BPF prog-id=107 op=UNLOAD
mag 24 14:15:05 linux-endeavour audit: BPF prog-id=106 op=UNLOAD
mag 24 14:15:05 linux-endeavour kernel: audit: type=1334 audit(1621858505.238:457): prog-id=108 op=UNLOAD
mag 24 14:15:05 linux-endeavour kernel: audit: type=1334 audit(1621858505.238:458): prog-id=107 op=UNLOAD
mag 24 14:15:05 linux-endeavour kernel: audit: type=1334 audit(1621858505.238:459): prog-id=106 op=UNLOAD
nihui commented 3 years ago

try -t 200 or -t 100

bortox commented 3 years ago

I tried waifu2x-ncnn-vulkan -i $HOME/Scaricati/TEST/T1/ -o $HOME/Scaricati/TEST/T4/ -m /usr/share/waifu2x-ncnn-vulkan/models-upconv_7_anime_style_art_rgb/ -s 4 -g=1 -t 200 and waifu2x-ncnn-vulkan -i $HOME/Scaricati/TEST/T1/ -o $HOME/Scaricati/TEST/T4/ -m /usr/share/waifu2x-ncnn-vulkan/models-upconv_7_anime_style_art_rgb/ -s 4 -g=1 -t 100 but got segmentation error, so I tried

waifu2x-ncnn-vulkan -i $HOME/Scaricati/TEST/T1/ -o $tmpdir -m /usr/share/waifu2x-ncnn-vulkan/models-upconv_7_anime_style_art_rgb/ -s 2 -g=1
waifu2x-ncnn-vulkan -i $tmpdir -o $HOME/Scaricati/TEST/T4/ -m /usr/share/waifu2x-ncnn-vulkan/models-upconv_7_anime_style_art_rgb/ -s 2 -g=1

and it upscaled images 4x without throwing error but I wonder why -s 4 doesn't work in my case.