xinntao / Real-ESRGAN-ncnn-vulkan

NCNN implementation of Real-ESRGAN. Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration.
https://github.com/xinntao/Real-ESRGAN
Other
1.44k stars 173 forks source link

Any way to make this work on Mojave? #2

Open KeygenLLC opened 2 years ago

KeygenLLC commented 2 years ago

If trying to run this on Mojave (10.14.6), the GPU does render the image, but when it gets to where it needs to save it, it throws an error because it can't find the library for c++.1 which is not present on Mojave.

I haven't found a way to install the other c++.1, though the guys who make Homebrew are trying to find a way to do it for older macOS.

Edit: Apparently this does exist on Mojave, but maybe it's not the location that's expected. I found it in /usr/lib/libc++.1.dylib. Is there a way to point the app to this location or is this an older version that won't work?

You can see below how it errors out right before finishing:

[0 AMD Radeon Pro Vega 64]  queueC=0[1]  queueG=0[1]  queueT=0[1]
[0 AMD Radeon Pro Vega 64]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[0 AMD Radeon Pro Vega 64]  fp16-p/s/a=1/1/1  int8-p/s/a=1/1/1
[0 AMD Radeon Pro Vega 64]  subgroup=64  basic=1  vote=1  ballot=1  shuffle=1
0.00%
2.78%
5.56%
8.33%
11.11%
13.89%
16.67%
19.44%
22.22%
25.00%
27.78%
30.56%
33.33%
36.11%
38.89%
41.67%
44.44%
47.22%
50.00%
52.78%
55.56%
58.33%
61.11%
63.89%
66.67%
69.44%
72.22%
75.00%
77.78%
80.56%
83.33%
86.11%
88.89%
91.67%
94.44%
97.22%
dyld: lazy symbol binding failed: Symbol not found: __ZNSt3__14__fs10filesystem10__absoluteERKNS1_4pathEPNS_10error_codeE
  Referenced from: /Volumes/Projects_Active/realesrgan-ncnn-vulkan-20210901-macos/./realesrgan-ncnn-vulkan (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libc++.1.dylib

dyld: Symbol not found: __ZNSt3__14__fs10filesystem10__absoluteERKNS1_4pathEPNS_10error_codeE
  Referenced from: /Volumes/Projects_Active/realesrgan-ncnn-vulkan-20210901-macos/./realesrgan-ncnn-vulkan (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libc++.1.dylib

Abort trap: 6

This is a stable production machine and I can't install 10.15 on this machine because I need to run 32-bit software and plugins that do not exist in 64-bit for 10.15 or Big Sur. Also can't run it on my laptop with Big Sur because it only has Intel Iris graphics.

Please let me know if there is a way around this or if you can make a new build that will support 10.14.

Thanks

charlie0129 commented 2 years ago

Hmm, I solved this problem by copying libc++.1.dylib from macOS Catalina and replacing the one in Mojave. Just remember to backup the original one.

KeygenLLC commented 2 years ago

Hmm, I solved this problem by copying libc++.1.dylib from macOS Catalina and replacing the one in Mojave. Just remember to backup the original one.

Thanks, I'll give it a try.

ocococococ commented 1 year ago

Yes, indeed it works.

Once you have a copy of /usr/lib/libc++.1.dylib from macOS Catalina (can be taken from original .dmg), copy it in the same directory as realesrgan-ncnn-vulkan, and then patch realesrgan-ncnn-vulkan like this:

install_name_tool \
  -add_rpath "@executable_path/." \
  -change "/usr/lib/libc++.1.dylib" "@rpath/libc++.1.dylib" \
  realesrgan-ncnn-vulkan
ruohoruotsi commented 1 year ago

On Mojave (10.14.6) I was also able to get this to work using the same approach, but tweaked since I'm using the latest release v0.2.0 from April 24, 2022

After all these steps, it works and I'm doing blazing fast super-resolution on Mojave (which I cannot upgrade for different audio-driver related technical reasons)