---
# System prepended metadata

title: Linux Operation
tags: [CS]

---

---
title: 'Linux Operation'
tags: CS
---

# Table of Contents
[TOC]

## Create virtual environment
1. `pip3 install virtualenv` (install)
2. `pip3 show virtualenv` (find path)
3. `python3 /home/cmw/.local/lib/python3.6/site-packages/virtualenv hyperpose` (create virtual environment "hyperpose")
4.  `source hyperpose/bin/activate` (launch virtual environment)

## Modify environmental variable
### Method 1
1. `vim ~/.bashrc`
2. `export PATH="$PATH:/home/fedora/example"` (Add at the end of the file and then save)
3. `source ~/.bashrc`
### Method 2 (On the terminal)
1. `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/`
2. `echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/' >> ~/.bashrc`
3. `source ~/.bashrc` (Or restart the terminal)

## Nvidia Problem
1. Use nvidia-smi instruction, and wrong CUDA version is shown. (I install CUDA 10.0)
![](https://i.imgur.com/hhN2Rgv.png)

+ Sol: It's because **the CUDA VERSION displayed by nvidia-smi associated with newer drivers is the DRIVER API COMPATIBILITY VERSION.** 
It does not indicate anything at all about what CUDA version is actually installed. 
For example: A 410.72 driver will display CUDA VERSION 10.0 even when no CUDA toolkit is installed.

## Force to stop process
1. https://blog.gtwang.org/linux/linux-kill-killall-xkill/