{%hackmd theme-dark %} After Installing Ubuntu (Detailed version) ========================================== Contents -------- [ToC] ****************************************************************** Cuda ---- - [Download](https://developer.nvidia.com/cuda-downloads) - Or run thefollowing commands, ```console= wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" sudo apt-get update sudo apt-get -y install cuda ``` - Check `nvidia-smi` <details> <summary>Setting Cuda path on .bashrc</summary> - Open .bashrc ```console nano ~/.bashrc ``` - Add this lines to .bashrc file ```console export CUDAHOME=/usr/local/cuda export PATH=${CUDAHOME}/bin:${CUDAHOME}/NsightCompute-2019.3${PATH:+:${PATH}} export LD_LIBRARY_PATH=${CUDAHOME}/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} ``` ```console sudo sh ~/.bashrc ``` </details> CudaNN ------ - Reference [Document](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html) - Download [cudNN](https://developer.nvidia.com/cudnn) - cuDNN Runtime Library for Ubuntu18.04 (Deb) - cuDNN Developer Library for Ubuntu18.04 (Deb) - cuDNN Code Samples and User Guide for Ubuntu18.04 (Deb) - Installing from a Debian File - Navigate to your <cudnnpath> directory containing cuDNN Debian file. - Install the runtime library, for example: `sudo dpkg -i libcudnn7_7.6.5.32-1+cuda10.2_amd64.deb` - Install the developer library, for example: `sudo dpkg -i libcudnn7-dev_7.6.5.32-1+cuda10.2_amd64.deb` - Install the code samples and the cuDNN Library User Guide, for example: `sudo dpkg -i libcudnn7-doc_7.6.5.32-1+cuda10.2_amd64.deb` - Verifying The cuDNN Install On Linux - To verify that cuDNN is installed and is running properly, compile the mnistCUDNN sample located in the /usr/src/cudnn_samples_v7 directory in the debian file. ```console cp -r /usr/src/cudnn_samples_v7/ $HOME cd $HOME/cudnn_samples_v7/mnistCUDNN make clean && make ./mnistCUDNN ``` - If cuDNN is properly installed and running on your Linux system, you will see a message similar to the following: `Test passed!` - Also check, `nvcc --version` Setup ----- ### Install Pyenv Procedure ```console sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ xz-utils tk-dev libffi-dev liblzma-dev python-openssl git git clone https://github.com/pyenv/pyenv.git ~/.pyenv echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc exec "$SHELL" pyenv install 3.7.3 pyenv global 3.7.3 python --version ``` </details> <details> <summary>Virtual Environment Setup</summary> ## Prerequisites * Setup pyenv * Set global pyenv version to 3.7.3 ## Install virtualenv ```console pip install virtualenv ``` ## Create a new virtual environment ```console virtualenv venv ``` ## Activate your virtual environment ```console source venv/bin/activate pip install <dependencies go here> ``` ## Export your dependencies ```console pip freeze > requirements.txt ``` ## Import your dependencies ```console pip install -r requirements.txt ``` </details> <details> <summary>Pip install</summary> - ```console pip install torch torchvision Cython ``` </details> - Check Cuda on torch ```console pip install torch torchvision ``` ```python$= import torch torch.cuda.is_available() print(torch.cuda.get_device_name(0)) print('Allocated:', round(torch.cuda.memory_allocated(0)/1024**3,1), 'GB') print('Cached: ', round(torch.cuda.memory_cached(0)/1024**3,1), 'GB') ``` Important Sofwares ------------------ - [Chrome](https://www.google.com/chrome/) - [Slack](https://slack.com/intl/ja-jp/downloads/linux) - [Teamviewer](https://www.teamviewer.com/en/download/linux/) - [VS Code](https://code.visualstudio.com/download) - [Pycharm](https://www.jetbrains.com/pycharm/download/#section=linux) - [typora](https://typora.io/#linux) - VLC `sudo snap install vlc` - [SimpleNote](https://github.com/Automattic/simplenote-electron/releases/tag/v1.15.1) `sudo snap install simplenote` Better Ubuntu ------------- ### Minimize on Click Enable ‘Minimize on Click’ for the Ubuntu Dock `gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'` ### gnome-tweaks `sudo apt-get install gnome-tweaks` ### Terminator - Add Terminator Repository: ```console sudo add-apt-repository ppa:gnome-terminator ``` - Update sources.list ```console sudo apt-get update ``` - Install Terminator ```console sudo apt-get install terminator ``` Open Software & Updates, Other Software tab. find the PPA definition that contains "gnome-terminator" select it and click Edit change the Distribution field from yakkety to xenial <details> <summary>Keyboard</summary> [(ref)](https://help.ubuntu.com/community/JapaneseInput) 1. Run the following command in the terminal and then reboot ``` sudo apt install -y ibus-mozc ``` 2. Open Region & Language  3. Click on Manage Installed Languages  4. Click on Install  5. Close  6. Click on + sign  7. Click on Japanese  8. Click on Japanese (Mozc) then add  \  </details> *** Bash ---- <details> <summary>How to update bash commands</summary> - Open .bashrc ```console nano ~/.bashrc ``` - Add this lines to .bashrc file ```console export dataset=/home/jitesh/detectron_tutorial/dataset export dl=/home/jitesh/Downloads ``` - Update bashrc ```console sudo sh ~/.bashrc ``` </details> ### [bashrc](/TRh_PAp_Qt2cadomJKqSFA) ### [bash_aliases](/rLZ7nua0T5yETALUIcXDqQ) -------------
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up