sudo snap install lxd
sudo lxd init
The defaults are mostly fine, but I used a dir
storage backend for simplicity:
Would you like to use LXD clustering? (yes/no) [default=no]: no
Do you want to configure a new storage pool? (yes/no) [default=yes]: yes
Name of the new storage pool [default=default]: default
Name of the storage backend to use (btrfs, ceph, dir, lvm) [default=btrfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]: no
Would you like to create a new local network bridge? (yes/no) [default=yes]: yes
What should the new bridge be called? [default=lxdbr0]: lxdbr0
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: auto
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: auto
Would you like LXD to be available over the network? (yes/no) [default=no]: no
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]: yes
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: no
sudo lxc launch images:centos/7/arm64 centos
Note: this should not be necessary, but it is the only way I have found to get ping
and raw sockets to work
sudo lxc config set centos security.privileged true
sudo lxc restart centos
sudo lxc exec centos -- /bin/ln -sf $(readlink /etc/localtime) /etc/localtime
Note: the device list comes from https://github.com/Technica-Corporation/Tegra-Docker#simple-gpu-docker-image
DEVICES="/dev/nvmap /dev/nvhost-ctrl /dev/nvhost-ctrl-gpu /dev/nvhost-prof-gpu /dev/nvhost-gpu /dev/nvhost-as-gpu"
for DEVICE in $DEVICES; do
sudo lxc config device add centos $DEVICE unix-char path=$DEVICE
done
sudo lxc exec centos -- chmod a+rw $DEVICES
sudo lxc exec centos -- bash -c "echo -e \"\n# make NVIDIA devices accessible to all users\nchmod a+rw $DEVICES\" >> /etc/rc.local"
sudo lxc config device add centos cuda-10.0 disk source=/usr/local/cuda-10.0 path=/usr/local/cuda-10.0
sudo lxc exec centos -- ln -s cuda-10.0 /usr/local/cuda
echo /usr/local/cuda-10.0/targets/aarch64-linux/lib | sudo lxc exec centos -- tee /etc/ld.so.conf.d/cuda-10-0.conf
sudo lxc config device add centos nvidia-tegra disk source=/usr/lib/aarch64-linux-gnu/tegra path=/usr/lib64/tegra
sudo lxc exec centos -- ln -s tegra/libcuda.so /usr/lib64/libcuda.so
echo /usr/lib64/tegra | sudo lxc exec centos -- tee /etc/ld.so.conf.d/nvidia-tegra.conf
sudo lxc exec centos -- ldconfig
sudo lxc exec centos -- /bin/bash
yum -y update
# install a glut library (used by the CUDA samples)
yum -y install freeglut freeglut-devel
# install varius usefulpackages
yum -y install sudo vim wget rsync krb5-workstation xauth git subversion bash-completion \
mlocate screen zip unzip readline-devel python-devel bc finger tcl-devel tk-devel
# add the EPEL (Extra Packages for Enterprise Linux) repository
yum -y install epel-release
updatedb
exit
sudo reboot