Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Describe how to install CycleGAN from a clean Ubuntu 18.04.1 install
Installing CycleGAN
# Zero : install basic packages :
sudo apt install git luarocks
# FIRST : Install Torch :
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh # FAILS
# To fix :
sudo apt-get install -y build-essential gcc g++ curl \
cmake libreadline-dev git-core libqt4-dev libjpeg-dev \
libpng-dev ncurses-dev imagemagick libzmq3-dev gfortran \
unzip gnuplot gnuplot-x11 ipython
# Install dependencies
luarocks install nngraph # FAILS
# Alternatively, Quasimondo tells us to run this instead:
# luarocks --from=https://raw.githubusercontent.com/torch/rocks/master/ install nngraph
# but let's keep it clean and simply use Torch's luarocks version:
sudo ~/torch/install/bin/luarocks install nngraph
sudo ~/torch/install/bin/luarocks install class
# This fails for no good reason : (http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=])
sudo ~/torch/install/bin/luarocks install https://raw.githubusercontent.com/szym/display/master/display-scm-0.rockspec # FAILS
/home/nathan/torch/install/bin/luarocks install https://raw.githubusercontent.com/szym/display/master/display-scm-0.rockspec
DATA_ROOT=./datasets/ae_photos name=style_cezanne_pretrained model=one_direction_test phase=test loadSize=256 fineSize=256 resize_or_crop="scale_width" th test.lua
# = FAILS because
# torch/install/share/lua/5.1/trepl/init.lua:389: module 'cutorch' not found:No LuaRocks module found for cutorch
# Install CUDA
# Make sure this is installed
sudo apt-get install linux-headers-$(uname -r)
# Download and install .deb
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal
# Use tab for version auto-completion
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
# Make sure to do post-installation stuff. Add this line to .bashrc
export PATH="/usr/local/cuda-10.0/bin:$PATH"
# Check if active:
systemctl status nvidia-persistenced
# if not, run this:
sudo systemctl enable nvidia-persistenced
# if still not, reboot.
# Do POWER9 stuff
sudo cp /lib/udev/rules.d/40-vm-hotadd.rules /etc/udev/rules.d
# Edit file /etc/udev/rules.d/40-vm-hotadd.rules and comment this line:
# SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory[0-9]*", TEST=="state", ATTR{state}="online"
# Reboot system now
# Install Deepo :
# Follow instructions here :
https://github.com/ufoym/deepo
# Install Docker :
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce
# Install nvidia-docker
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
# Test
sudo docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
# Download Deepo:
sudo docker pull ufoym/deepo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment