To set up the waifu2x command line environment on Ubuntu 16.04, follow these steps to install CUDA, system dependencies, Torch7, and the waifu2x repository.
1. Install CUDA
Download and install CUDA using dpkg:
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install cuda
2. Install System Dependencies
Install the required development libraries:
sudo apt-get install libsnappy-dev
sudo apt-get install libgraphicsmagick1-dev
sudo apt-get install libssl1.0-dev
Note: waifu2x requires little-cms2 linked graphicsmagick.
3. Install Torch7
Follow the official Torch getting started guide. Ensure compatibility with your CUDA version (refer to repository issues for CUDA 8.x, 9.x, and 10.x).
4. Clone and Install waifu2x
Clone the repository and run the provided installation script for Lua modules:
git clone --depth 1 https://github.com/nagadomi/waifu2x.git
cd waifu2x
./install_lua_modules.sh