Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Latest commit

 

History

History
113 lines (85 loc) · 3.72 KB

BUILDING.md

File metadata and controls

113 lines (85 loc) · 3.72 KB

Waifu2x source building guides

You can download pre-built Windows binaries from:

https://github.com/DeadSix27/waifu2x-converter-cpp/releases

Guide Index:

  • Windows x64
  • Linux (ARM is not supported, but could work maybe, open an issue if you get it working.)
  • MacOS

Windows

Requirements:

AMD GPUs:

  1. Download the AMD APP SDK [ AMD-SDK-InstallManager-v1.4.87-1.exe ] Note: Currently that link is dead, see here for info and here for alternative downloads.

  2. Install the AMD SDK (you only need OpenCL and OpenCL runtime)

nVidia GPUs:

  1. Download the CUDA SDK 10 [ cuda_10.*_win10.exe ]

  2. Install the CUDA SDK (you only need to select CUDA->Development and CUDA->Runtime).

Building for both GPU brands:

Install both SDK's as shown above, but later add "-DFORCE_DUAL=ON" to the cmake command.

Building with UNICODE support:

Add "-DBUILD_UNICODE=ON" to the cmake command.

Building:

We will be using K:/w2x as our base folder for this guide.
If you want to build for both GPU brands, just install both SDKs (see above).
  1. Download OpenCV 4.* [ opencv-4.*-vc14_vc15.exe ]

  2. Extract OpenCV to your base folder e.g K:/w2x/opencv

  3. Open a Command prompt and run the following command: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64

  4. Now run these commands in order, to build w2x:

    	cd "K:/w2x/"
    	git clone "https://github.com/DeadSix27/waifu2x-converter-cpp"
    	cd "waifu2x-converter-cpp"
    	mkdir out && cd out
    	cmake .. -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" -DOPENCV_PREFIX="K:/w2x/opencv/build/"
    	msbuild waifu2xcpp.sln /p:Configuration=Release /p:Platform=x64
    	copy K:\w2x\opencv\build\x64\vc15\bin\opencv_world400.dll Release\
    	mkdir Release\models_rgb\ && copy ..\models_rgb Release\models_rgb\

Linux

Requirements:

  • GCC 6+
  • CMake
  • OpenCV 3+

Intel GPUs:

  • Arch:
    • sudo pacman -S beignet clinfo
  • Ubuntu:
    • sudo apt install beignet-opencl-icd opencl-headers

AMD GPUs:

  • Arch:
    • sudo pacman -S opencl-mesa clinfo
  • Ubuntu:
    • sudo apt install mesa-opencl-icd opencl-headers

nVidia GPUs:

  • Feel free to contribute to this guide

Building:

If you want to build for all GPU brands, just install all packages (untested, see above).

Run these commands in order:

git clone "https://github.com/DeadSix27/waifu2x-converter-cpp"
cd waifu2x-converter-cpp
mkdir out && cd out
cmake ..
make -j4
sudo make install

If needed run sudo ldconfig after the install.

MacOS / OSX

You need Homebrew installed, as well as XCode for the compiler. The following has been tested on OSX Sierra 10.12.6:

$ brew tap science && brew install opencv3
$ git clone https://github.com/DeadSix27/waifu2x-converter-cpp && cd waifu2x-converter-cpp
$ cmake -DOPENCV_PREFIX=/usr/local/Cellar/opencv3/<your version here> .
$ make -j4
$ cp -r models_rgb models