Skip to content

Instantly share code, notes, and snippets.

@ksuperman
ksuperman / cuda-setup.md
Created March 11, 2017 05:20 — forked from soareschen/cuda-setup.md
CUDA setup on Ubuntu 16.04 and LXD

This gist explains the steps required to install CUDA on Ubuntu 16.04 as well as enabling it inside LXD containers.

The setup assumes GTX 10 series hardware, tested with my GTX 1070.

Driver Installation

Download the latest Nvidia driver at http://www.nvidia.com/Download/index.aspx.

On 64-bit systems, install 32-bit OpenGL libaries first so that the driver will install

# Suppose we already have LXD, and already add the default image repo as images:
# 1. Start a new Trusty LXC container
host:~$ lxc launch images:ubuntu/trusty/amd64 cuda-trusty
# 2. Download and install CUDA on *both* host & LXC container, from https://developer.nvidia.com/cuda-downloads
# Note that host and container have to have *exactly* the same driver version
# 3. Add necessary Nvidia devices to LXC container
host:~$ lxc config device add cuda-trusty nvidia0 unix-char path=/dev/nvidia0
host:~$ lxc config device add cuda-trusty nvidiactl unix-char path=/dev/nvidiactl
@ksuperman
ksuperman / deepmask.md
Created March 12, 2017 05:44 — forked from ryanfb/deepmask.md
DeepMask / SharpMask training notes

About

These are my public, unorganized notes on stumbling blocks I've run across setting up DeepMask / SharpMask for training: https://github.com/facebookresearch/deepmask

NNProject_DeepMask

An alternative (non-Facebook, Python instead of Torch) open-source implementation of DeepMask was previously available here: https://github.com/abbypa/NNProject_DeepMask

Before the Facebook code was released, I started some work on Dockerizing this implementation which may also help others use it: https://github.com/ryanfb/NNProject_DeepMask/blob/docker_experimental/Dockerfile

@ksuperman
ksuperman / resize.sh
Created March 13, 2017 00:52 — forked from mifix/resize.sh
LXD - ZFS - resize
# make sure zfs autoexpand is enabled (only needed once)
sudo zpool set autoexpand=on lxd
sudo truncate -s 50G /var/lib/lxd/zfs.img
# Make zfs realize the fact that partition has been changed and make zpool
# use the new partition which is actually the same one
sudo zpool online -e lxd /var/lib/lxd/zfs.img /var/lib/lxd/zfs.img
@ksuperman
ksuperman / exif.html
Created April 17, 2017 15:20 — forked from maxim75/exif.html
Reading EXIF info from image with JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<title>h5</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
<script src="exif.js"></script>
<style>
#holder { border: 1px dashed #ccc; width: 100px; height: 100px; margin: 20px auto;}
#holder.hover { border: 1px dashed #333; }
#result .property { width: 100px; }