分类 "ubuntu系统" 下的文章

Install ONNX Runtime CPU

pip install onnxruntime

Install ONNX Runtime GPU (CUDA 11.x)
The default CUDA version for ORT is 11.8.

pip install onnxruntime-gpu

Install ONNX Runtime GPU (CUDA 12.x)
For Cuda 12.x, please use the following instructions to install from ORT Azure Devops Feed

pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/

from https://onnxruntime.ai/docs/install/


安装 basicsr

pip install -i https://mirrors.aliyun.com/pypi/simple tb-nightly
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple basicsr==1.4.2

root下visudo
例如添加

useyyyy  ALL=(ALL:ALL) ALL
usexxxxx ALL=(ALL) NOPASSWD:ALL

如果出现a world file 修改权限,例如

chmod 0440 /etc/sudoers.d/ai_sudoer
chown root:root /etc/sudoers.d/ai_sudoer

swappiness,Linux内核参数,控制换出运行时内存的相对权重。swappiness参数值可设置范围在0到100之间。 低参数值会让内核尽量少用交换,更高参数值会使内核更多的去使用交换空间。默认值为60(参考网络资料:当剩余物理内存低于40%(40=100-60)时,开始使用交换空间)。对于大多数操作系统,设置为100可能会影响整体性能,而设置为更低值(甚至为0)则可能减少响应延迟。
swappiness参数值说明
vm.swappiness = 0
仅在内存不足的情况下--当剩余空闲内存低于vm.min_free_kbytes limit时,使用交换空间。
vm.swappiness = 1
内核版本3.5及以上、Red Hat内核版本2.6.32-303及以上,进行最少量的交换,而不禁用交换。
vm.swappiness = 10
当系统存在足够内存时,推荐设置为该值以提高性能。
vm.swappiness = 60(默认值)
vm.swappiness = 100 (内核将积极的使用交换空间)
对于内核版本为3.5及以上,Red Hat内核版本2.6.32-303及以上,多数情况下,设置为1可能比较好,0则适用于理想的情况下

首先需要创建swap

阅读全文

删除现有的cuda\nvcc\nccl\nvidia*

sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*" libnccl-dev libnccl2 -y
sudo apt-get --purge remove "*nvidia*" -y
sudo apt autoremove -y
sudo rm -rf /usr/local/cuda*

准备工作【可以不做】
设置apt源
清华 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu-ports/
阿里 https://developer.aliyun.com/mirror/ubuntu


cuda-toolkit下载入口 https://developer.nvidia.com/cuda-toolkit-archive
nccl下载入口https://docs.nvidia.com/deeplearning/nccl/install-guide/#down


阅读全文