nihui / waifu2x-ncnn-vulkan

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

SPIR-V compilation error and segfault on RX 6800 #155

Closed dbekatli closed 3 years ago

dbekatli commented 3 years ago

Hello,

This program and the other ncnn-vulkan image upscalers don't work on my system since I switched to an RX 6800, other vulkan programs such as games or vkFFT work fine. This is the error I get.

WARNING: radv is not a conformant vulkan implementation, testing use only.
[0 AMD Radeon RX 6800]  queueC=1[4]  queueG=0[1]  queueT=2[2]
[0 AMD Radeon RX 6800]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[0 AMD Radeon RX 6800]  fp16-p/s/a=1/1/1  int8-p/s/a=1/1/1
[0 AMD Radeon RX 6800]  subgroup=64  basic=1  vote=1  ballot=1  shuffle=1
compile spir-v module failed
ERROR: 0:10: 'constant_id' : only allowed when generating SPIR-V 
ERROR: 0:10: '' : compilation terminated 
ERROR: 2 compilation errors.  No code generated.

The "compile spir-v module failed" part repeats a lot of times and the program eventually segfaults. I've tested it with the RADV and AMDVLK backends but it doesn't help. This is on kernel 5.12.8 and mesa 21.1.1.

dbekatli commented 3 years ago

Upon further testing I found out that this is related to the AUR package waifu2x-ncnn-vulkan-git. The issue is not present if I build the program according to the instructions in the README. The AUR package however uses these two specific arguments while during configuration: -DGLSLANG_TARGET_DIR=/usr/lib/cmake -DUSE_SYSTEM_NCNN=on, the issue only occurs if the program is built with these options. The issue is probably caused by the AUR package or the libraries on my system so I'm closing this.

catthou commented 3 years ago

@d0809 Do you have an idea what caused this? Was it the version of your system-wide ncnn? Lib path wrong? I'm having the same errors and the gentoo ebuild uses the same options but I'm not sure I want to use the ncnn from this repository, even as a troubleshooting measure. I'm wondering if there's just maybe an incompatible version somewhere. I'm using a GTX 1050 Ti and I haven't changed my video card since it was last working, which is why I suspect there's a library mismatch.

albel727 commented 3 years ago

@catthou a newer ncnn solved the problem for me. just copy and digest the ncnn ebuild:

cp ncnn-20210525.ebuild ncnn-20210720.ebuild
ebuild ncnn-20210720.ebuild digest

then edit waifu2x-ncnn-vulkan-20210521.ebuild and change the RDEPEND to accept the new ncnn version.

RDEPEND="
    ~dev-libs/ncnn-20210720[vulkan]

then digest it too: ebuild waifu2x-ncnn-vulkan-20210521.ebuild digest then you can emerge -1 ncnn waifu2x-ncnn-vulkan