# 2021 GW RD server with Ubuntu 18.04 Desktop setup ###### tags: `Setup`,`Tutorial` ### Mount disk * Use ubuntu disks UI * Gear icon -> "Edit mount options" * Turn off "User Session Defaults" * Display Name `$YOUR_NAME` * Mount Point: `/mnt/$YOUR_NAME` (all lower case) * Requires reboot ### (optional) Setup vlan * Rcommanded: use the default "_Network Manager_" ```bash nm-connection-editor ``` * Other option: Netplan + interface (**TBD**) ```config # /etc/network/interface # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback #auto eno1 #iface eno1 inet static # address 172.19.134.51 # netmask 255.255.255.0 # gateway 172.19.134.254 # dns-nameservers 8.8.8.8 #auto eno1.133 #iface eno1.133 inet static # address 172.19.133.51 # netmask 255.255.255.0 # vlan-raw-device eno1 # gateway 172.19.133.254 # broadcast 172.19.133.255 # dns-nameservers 8.8.8.8 # dns-nameservers 1.1.1.1 ``` ```yaml # /etc/netplan/*.yaml network: version: 2 ethernets: eno1: {} vlans: eno1.133: id: 101 link: eno1 addresses: [172.19.133.51/24] gateway4: 172.19.133.254 nameservers: search: [local] addresses: [1.1.1.1, 8.8.8.8] ``` # Common software ### Common dependencies ```bash sudo apt-get install vim \ htop \ kate git\ openssh-server \ byobu \ build-essential cmake unzip pkg-config ctags ``` ### Profiling (optional) ```bash sudo apt install linux-tools-generic \ linux-tools-$(uname -r) libunwind-dev google-perftools ``` Modify profiling authentication ```bash # edit from 3 to -1 / from ? to 0 sudo sh -c " echo -1 > /proc/sys/kernel/perf_event_paranoid" sudo sh -c " echo 0 > /proc/sys/kernel/kptr_restrict" ``` ### NV driver & CUDA for CBTN **Please make sure what you're doing** Note: do not use .run script if your'e planning to use tensorRT ```bash sudo apt-get install nvidia-driver-470 ``` * [Cuda 11.1.0](https://developer.nvidia.com/cuda-11.1.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Debian&target_version=10&target_type=deblocal) (Required due to TensorRT 7.2.3) 11.1.1: https://developer.nvidia.com/cuda-11.1.1-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Debian&target_version=10) ```bash #wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda-repo-debian10-11-1-local_11.1.1-455.32.00-1_amd64.deb wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda-repo-debian10-11-1-local_11.1.0-455.23.05-1_amd64.deb sudo dpkg -i cuda-repo-debian10-11-1-local_11.1.1-455.32.00-1_amd64.deb sudo apt-key add /var/cuda-repo-debian10-11-1-local/7fa2af80.pub sudo add-apt-repository contrib # is this required? sudo apt-get update sudo apt-get -y install cuda cuda-11-1 ``` * [Cuda 11.2](https://developer.nvidia.com/cuda-11.2.0-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Debian&target_version=10&target_type=runfilelocal): During install script, please disable install of driver-460 (driver-470 should support 11.1) ```bash wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda_11.2.0_460.27.04_linux.run sudo sh cuda_11.2.0_460.27.04_linux.run ``` * [TensorRT 7.2.3](https://docs.nvidia.com/deeplearning/tensorrt/release-notes/tensorrt-7.html#rel_7-2-3) ### OpenCV (4.2.0) https://github.com/opencv/opencv/releases/tag/4.2.0 https://github.com/opencv/opencv_contrib/releases/tag/4.2.0 ```bash # System dependencies # libjasper sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" sudo apt update sudo apt install libjasper1 libjasper-dev # image and video I/O libraries. sudo apt-get install libjpeg-dev libpng-dev libtiff-dev \ libtbb2 libtbb-dev libjasper-dev libdc1394-22-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ libxvidcore-dev libx264-dev #GTK for our GUI backend, mathematical optimizations libraries, python sudo apt-get install libgtk-3-dev libatlas-base-dev \ gfortran python3-dev python3-numpy # Download release 4.2.0 or above to wherever place you'd like mkdir opencv && cd opencv wget -O opencv.zip https://github.com/opencv/opencv/archive/4.2.0.zip wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.2.0.zip unzip opencv.zip && mv opencv-4.2.0 opencv unzip opencv_contrib.zip && mv opencv_contrib-4.2.0 opencv_contrib # Setup configuration and build cd opencv && mkdir build && cd build cmake -D CMAKE_BUILD_TYPE=Release \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=ON \ -D OPENCV_ENABLE_NONFREE=ON \ -D PYTHON3_EXECUTABLE=/usr/bin/python3 \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \ -D BUILD_EXAMPLES=ON .. make -j7 # Modify according to available CPUs sudo make install ``` ### Ceres Solver ```bash # Dependencies: CMake, google-glog + gflags, BLAS & LAPACK, Eigen3 sudo apt-get install cmake libgoogle-glog-dev libatlas-base-dev libeigen3-dev # SuiteSparse and CXSparse (optional) # - If you want to build Ceres as a *static* library (the default) # you can use the SuiteSparse package in the main Ubuntu package # repository: sudo apt-get install libsuitesparse-dev # - However, if you want to build Ceres as a *shared* library, you must # add the following PPA: sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687 sudo apt-get update sudo apt-get install libsuitesparse-dev mkdir ceres && cd ceres # Download release archive of 1.14.0 wget https://github.com/ceres-solver/ceres-solver/archive/1.14.0.tar.gz tar zxf 1.14.0.tar.gz # Build the code and install the library # It can also be exported using CMake which # allows Ceres to be used without requiring installation, see the documentation # for the EXPORT_BUILD_DIR option for more information. mkdir ceres-bin && cd ceres-bin cmake ../ceres-solver-1.14.0 make -j3 make test sudo make install ``` ### Add group/ user (with Ubuntu) ```bash sudo add user $USER # Add user sudo groupadd -g 16384 $GROUP # Add group usermod -aG sudo $USER # Add user to group "sudo": # Other helpers #List User: cut -d: -f1 /etc/passwd #Expire user: sudo usermod --expiredate 1 $USER #Check User status: sudo chage -l $USER #List sudoers: grep -Po '^sudo.+:\K.*$' /etc/group #Change to user: sudo -u $USER -s #Delete user: deluser --remove-home newuser ```