Cheatsheets

Install Docker: The following steps can be used to setup NVIDIA Container Toolkit on Ubuntu LTS - 16.04, 18.04, 20.4 and Debian - Stretch, Buster distributions 1:

curl https://get.docker.com | sh \
  && sudo systemctl --now enable docker
sudo usermod -aG docker $USER

Setting up NVIDIA Container Toolkit (after system reboot):

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
   && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

To enable CUDA on WSL and MIG, refer to the guide 1. Install the nvidia-docker2 package:

sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

Now test the installation:

docker run --rm --gpus all nvidia/cuda:11.1.1-base nvidia-smi

Tensorflow containers requires special arguments to bypass the system limit (increasing shared memory):

docker run \
--gpus all -it \
--shm-size=1g --ulimit memlock=-1 \
--ulimit stack=6710886 \
nvcr.io/nvidia/tensorflow:19.06-py3

Reference

  1. https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker  2

Two options:

Chinese input:

Install sogou pinyin

Install wechat:

2021-8-3: Tested on Ubuntu 20.04.02 LTS with kernel 5.8.0-43-generic

Note: caution using xhost + as it also allows malicious access. Prefer --network=host when accessing your local x-server from docker. (Reference)

docker run -d \
--name wechat \
--device /dev/snd \
--ipc="host" \
--network=host \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/Documents/wechat:/WeChatFiles \
-e DISPLAY=unix$DISPLAY \
-e XMODIFIERS=@im=fcitx \
-e QT_IM_MODULE=fcitx \
-e GTK_IM_MODULE=fcitx \
-e AUDIO_GID=`getent group audio | cut -d: -f3` \
-e GID=`id -g` \
-e UID=`id -u` \
bestwu/wechat

Icon extension

sudo apt install gnome-shell-extension-top-icons-plus
gnome-extensions-app

Compatibility

WeChat compatibility list

Pigz Supports only tar.gz files:

sudo apt install pigz
tar -c --use-compress-program=pigz -f <filename>.tar.gz <dir-to-zip>