所有wiki整合,便于查找。
Linux 软件安装 bootable device: ventoy refus
clash for windows sogou pinyin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bcakup sudo gedit /etc/apt/sources.list wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Linux-x86_64.sh sh Anaconda3-5.3.1-Linux-x86_64.sh wget -O- https://deepin-wine.i-m.dev/setup.sh | sh sudo apt-get install com.qq.weixin.deepin sudo apt install libjpeg62:i386 sudo dpkg -i com.alibabainc.dingtalk_**_amd64.deb sudo apt install proxychains4 sudo vim /etc/proxychains4.confecho "alias pc4='proxychains4 -q'" >> ~/.bash_aliasessource ~/.bash_aliases pc4 ... docker run --name dockermysql -p 13306:3306 -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=tank -e TZ=Asia/Shanghai -d mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-time_zone=+8:00 docker run --name tank -p 6010:6010 --link dockermysql:mysql -v ~/data/dockermatter:/data/build/matter -d eyeblue/tank:3.1.6 sudo docker start dockermysql sudo docker start tank sudo vi /usr/share/applications/firefox.desktop wget -O droidcam_latest.zip https://files.dev47apps.net/linux/droidcam_2.0.0.zip unzip droidcam_latest.zip -d droidcamcd droidcam && sudo ./install-client sudo apt install libappindicator3-1 [Desktop Entry] Name=firefox Name[zh_CN]=firefox Comment=firefox Exec=/opt/firefox/firefox Icon=/opt/firefox/browser/chrome/icons/default/default128.png Terminal=false Type=Application Categories=Application; Encoding=UTF-8 StartupNotify=true
系统管理 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 htop # 查看PID cat /proc/$PID/status | grep PPid # 父进程ID kill -9 $PPid# 批量杀死进程 ps -elf |grep open-mmlab |awk '{print $4}'|xargs kill -9# 磁盘 sudo iotop -oP# 内存 htop# GPU nvidia-smi# timezone tzselect sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime sudo hwclock --systohc date# 系统升级 cat /etc/os-release sudo apt update && sudo apt full-upgrade sudo do-release-upgrade
Nvidia显卡相关 1 2 3 4 5 6 7 8 # 指定显卡 os.environ["CUDA_VISIBLE_DEVICES"] = '0' # python export CUDA_VISIBLE_DEVICES=0 # sh# 适用内核更新导致,or reinstall cuda dirver ls /usr/src | grep nvidia sudo apt install dkms sudo dkms install -m nvidia -v ***.**.**
小问题合集 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 unzip -O CP936 filename.zip python setup.py sdist build twine upload dist/* gedit ~/.config/mimeapps.list text/html=baidunetdisk.desktop text/html=firefox.desktop;org.gnome.gedit.desktop;userapp-Firefox-MEQ910.desktop; 下载字体 [SimHei.ttf](https://www.fontpalace.com/font-download/SimHei/), 移动到 `/site-packages/matplotlib/mpl-data/fonts/ttf` mv SimHei.ttf ../site-packages/matplotlib/mpl-data/fonts/ttf rm -rf /home/tyler/.cache/matplotlib gedit ../site-packages/matplotlib/mpl-data/matplotlibrc font.family : sans-serif font.sans-serif : SimHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif axes.unicode_minus : Falsealias nn='watch -n 1 -d nvidia-smi' alias sb='source ~/.bashrc' alias cod='conda deactivate' alias coa='conda activate' alias col='conda env list' alias pc4='proxychains4 -q' alias pyserver='python -m http.server 8888' alias tar='tar -zxvf' alias tarz='tar -zcvf' alias hexoss='hexo clean && hexo g && hexo s'
Envs apt source 1 2 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bcakup sudo gedit /etc/apt/sources.list
ref tsinghua mirror
pip source pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
conda source
pytorch official site , conda pytorch
opencv python3 cuda 更新cmake版本 opencv cuda编程
opencv 编译官方指导
其中FAST_MATH
两个都是加速选项, 会一定程度影响精度
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 除了文档中的以外: pip install opencv-python coa base_py38_torch18_tf2 cmake \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D INSTALL_C_EXAMPLES=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-4.5.4/modules \ -D BUILD_OPENCV_PYTHON2=OFF \ -D ENABLE_FAST_MATH=ON \ -D CUDA_FAST_MATH=ON \ -D BUILD_OPENCV_PYTHON3=ON \ -D PYTHON_DEFAULT_EXECUTABLE=$(python -c "import sys; print(sys.executable)") \ -D PYTHON3_EXECUTABLE=$(which python3) \ -D PYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ -D PYTHON_INCLUDE_DIR2=$(python3 -c "from os.path import dirname; from distutils.sysconfig import get_config_h_filename; print(dirname(get_config_h_filename()))") \ -D PYTHON_LIBRARY=$(python3 -c "from distutils.sysconfig import get_config_var;from os.path import dirname,join ; print(join(dirname(get_config_var('LIBPC')),get_config_var('LDLIBRARY')))") \ -D PYTHON3_NUMPY_INCLUDE_DIRS=$(python3 -c "import numpy; print(numpy.get_include())") \ -D PYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \ -D BUILD_EXAMPLES=OFF \ -D WITH_CUDA=ON \ -D WITH_CUDNN=ON \ -D OPENCV_DNN_CUDA=ON \ -D WITH_CUBLAS=ON \ -D CUDNN_VERSION=8.2 \ -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.1 \ -D OpenCL_LIBRARY=/usr/local/cuda-11.1/lib64/libOpenCL.so \ -D OpenCL_INCLUDE_DIR=/usr/local/cuda-11.1/include/ \ .. make -j20 sudo make install sudo ldconfig cd /opt/anaconda3/envs/base_py38_torch18_tf2/lib/python3.8/site-packages/ ln -sf /usr/local/lib/python3.8/dist-packages/cv2/cv2.cpython-38-x86_64-linux-gnu.so cv2.so
conda base env 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 conda install mamba -n base -c conda-forge conda create -n base_py39x_torch1x2 python==3.9.10 pip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio==0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html pip3 install cv2box conda create --clone base_py39x_torch1x2 --name poseviz conda list --revisions conda install --rev 0source /opt/anaconda3/etc/profile.d/conda.sh conda activate full pip uninstall opencv-python opencv-contrib-python memba install -c conda-forge opencv
cuda cudnn安装 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 sudo nvidia-uninstall sudo chmod +x ./cuda.. sudo ./cuda.. sudo rm /usr/local /cuda sudo ln -s /usr/local /cuda.. /usr/local /cuda tar -xzvf cudnn.. sudo cp ./include/cudnn*.h /usr/local /cuda/include sudo cp ./lib/libcudnn* /usr/local /cuda/lib64 sudo chmod a+r /usr/local /cuda/include/cudnn.h /usr/local /cuda/lib64/libcudnn* nvcc -V
onnxruntime + cuda + tensorrt cmake =3.24.0 onnxruntime =1.13 cuda =11.6 cudnn =8.4.1.50 tensorrt =8.4.1.5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 python3 -m pip install cmakewhich cmake git clone --recursive https://github.com/microsoft/onnxruntime.git --depth 1 --branch v1.13.1 sudo gedit /etc/ld.so.conf sudo ldconfig ./build.sh --use_cuda --cudnn_home /usr/local /cuda/lib64 --cuda_home /usr/local /cuda --use_tensorrt --tensorrt_home ./TensorRT-8.4.1.5 --build_wheel --parallel --skip_tests pip install ./build/Linux/Debug/dist/onnxruntime_gpu-1.13.0-cp39-cp39-linux_x86_64.whl pip install -r requirements-dev.txt rm -r ./build
docker onnxruntime tensorrt tensorrt matrix cuda cuda docker hub
1 2 3 4 5 FROM {none image id} rewrite DOCKERFILE docker build -t onnxruntime-trt -f Dockerfile.tensorrt . --build-arg HTTPS_PROXY=http://xxxx:7890
Cheat sheet tmux
pathlib