kaifu2x icon indicating copy to clipboard operation
kaifu2x copied to clipboard

About trap 6 on macOS

Open misha-plus opened this issue 6 years ago • 4 comments

Hello. I run v0.3.0 -- it is good. But on v0.4 I have following problem

Reading 235520.jpg...Ok
Reading scale2.0x_model.json...Ok
[scale2] %.1f%% - ELA: 0.0 - ETA: 00:00:01 - MEM: 596:31:23 Abort trap: 6

I fastly looked to the code it uses half precision but on my MacBook Pro Mid 2013 with HD Graphics 4000 there is no half precision -- can this be the cause of the error?

misha-plus avatar Feb 13 '19 14:02 misha-plus

I've changed half to float -- it helps

misha-plus avatar Feb 14 '19 11:02 misha-plus

Can you make a PR?

soywiz avatar Feb 14 '19 11:02 soywiz

I can make it but this can make kernel slower on NVidia or AMD. Is this ok?

misha-plus avatar Feb 14 '19 12:02 misha-plus

Yeah, it is ok. If you are using a mac, I would suggest you to try https://github.com/imxieyi/waifu2x-mac it is an order of magnitude faster. I was not able to optimize it further using OpenCL and didn't investigate more. So I guess it is better to have something that works on most of the systems out of the box including linux, and if half-floats are not available everywhere better to use floats for now. And detect if half floats are available just as an optimization.

soywiz avatar Feb 14 '19 12:02 soywiz