Daniel Kang's blog

Blog

Home

Installing OpenCV 3.4 from source

Dependencies: sudo apt install cmake python-dev python-numpy gcc g++ sudo apt install python3-dev python3-numpy sudo apt install build-essential libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libavresample-dev sudo apt install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" sudo apt update sudo apt install libjasper1 libjasper-dev Install: git clone https://github.com/opencv/opencv.git git clone https://github.com/opencv/opencv_contrib.git cd opencv_contrib/ git checkout 3.4.4 cd ../opencv/ git checkout 3.4.4 mkdir build cd build cmake \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ \ -D OPENCV_ENABLE_NONFREE=True \ -D CMAKE_BUILD_TYPE=Release \ -D...


Installing CUDA 10.0, CuDNN 7.4.1, TensorRT 5.0.1 on Google Compute Engine

How to install CUDA 9.2, CuDNN 7.2.1, PyTorch nightly on Google Compute Engine. I expect this to be outdated when PyTorch 1.0 is released (built with CUDA 10.0). This uses Conda, but pip should ideally be as easy. Step 0: GCP setup (~1 minute) Create a GCP instance with 8 CPUs, 1 P100, 30 GB of HDD space with Ubuntu 16.04. Turn off host migration (GPU jobs can’t be resumed). Step 1: Installing CUDA (~5.5 minutes) You can also install...


Mounting a Blank Disk on Google Compute Engine

Change $MNT_DIR_NAME as desired. export MNT_DIR_NAME="data" sudo mkdir -p /mnt/disks/$MNT_DIR_NAME sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb sudo mount -o discard,defaults /dev/sdb /mnt/disks/$MNT_DIR_NAME sudo chmod a+w /mnt/disks/$MNT_DIR_NAME This will automatically mount the disk after reboot, but will not work if you switch disks: sudo cp /etc/fstab /etc/fstab.backup echo UUID=`sudo blkid -s UUID -o value /dev/sdb` \ /mnt/disks/$MNT_DIR_NAME ext4 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab


Installing CUDA 9.2, CuDNN 7.2.1, PyTorch nightly on Google Compute Engine

How to install CUDA 9.2, CuDNN 7.2.1, PyTorch nightly on Google Compute Engine. I expect this to be outdated when PyTorch 1.0 is released (built with CUDA 10.0). This uses Conda, but pip should ideally be as easy. Step 0: GCP setup (~1 minute) Create a GCP instance with 8 CPUs, 1 P100, 30 GB of HDD space with Ubuntu 16.04. Turn off host migration (GPU jobs can’t be resumed). Step 1: Installing CUDA (~5.5 minutes) You can also install...


About this Blog

Often times I have to perform a technical task that is very similar to something I’ve done before. This blog is mainly a list of tutorials for my future self, so I can do these tasks faster. I’m also hoping to put the expected completion times for the tutorials so I know when something is wrong. The tutorials will mostly be computer systems and deep learning related.