当前位置: 首页 > article >正文

阿木实验室SpireCV安装脚本

#!/bin/sh

# 下载安装包
wget https://download.amovlab.com/model/install/x86-nvidia/cuda-repo-ubuntu2004-11-6-local_11.6.2-510.47.03-1_amd64.deb
wget https://download.amovlab.com/model/install/x86-nvidia/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz
wget https://download.amovlab.com/model/install/x86-nvidia/nv-tensorrt-repo-ubuntu2004-cuda11.6-trt8.4.0.6-ea-20220212_1-1_amd64.deb
wget https://download.amovlab.com/model/install/x86-nvidia/cuda-ubuntu2004.pin

# 记录安装包所在路径
package_dir="."
cuda_fn=$package_dir"/cuda-repo-ubuntu2004-11-6-local_11.6.2-510.47.03-1_amd64.deb"
cudnn_fn=$package_dir"/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz"
tensorrt_fn=$package_dir"/nv-tensorrt-repo-ubuntu2004-cuda11.6-trt8.4.0.6-ea-20220212_1-1_amd64.deb"
tmp_dir="/tmp"
echo -e "\033[32m[INFO]: CUDA_PKG: \033[0m"$cuda_fn
echo -e "\033[32m[INFO]: CUDNN_PKG: \033[0m"$cudnn_fn
echo -e "\033[32m[INFO]: TENSORRT_PKG: \033[0m"$tensorrt_fn

# 所有文件都存在时,才会继续执行脚本
if [ ! -f "$cuda_fn" ]; then
  echo -e "\033[31m[ERROR]: CUDA_PKG not exist!: \033[0m"
  exit 1
fi
if [ ! -f "$cudnn_fn" ]; then
  echo -e "\033[31m[ERROR]: CUDNN_PKG not exist!: \033[0m"
  exit 1
fi
if [ ! -f "$tensorrt_fn" ]; then
  echo -e "\033[31m[ERROR]: TENSORRT_PKG not exist!: \033[0m"
  exit 1
fi


# 安装CUDA
echo -e "\033[32m[INFO]: CUDA installing ...\033[0m"
sudo cp $package_dir/cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo dpkg -i $cuda_fn
sudo apt-key add /var/cuda-repo-ubuntu2004-11-6-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

# 安装CUDNN
echo -e "\033[32m[INFO]: CUDNN installing ...\033[0m"
tar -xvf $cudnn_fn -C $tmp_dir
sudo cp $tmp_dir/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive/include/cudnn* /usr/local/cuda/include/
sudo cp $tmp_dir/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive/lib/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn* /usr/local/cuda/lib64/libcudnn*

sudo ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.4.1 /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
sudo ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libcudnn.so.8.4.1 /usr/local/cuda/targets/x86_64-linux/lib/libcudnn.so.8
sudo ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.4.1 /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
sudo ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.4.1 /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
sudo ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.4.1 /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
sudo ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.4.1 /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
sudo ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.4.1 /usr/local/cuda/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8

# 安装TensorRT
echo -e "\033[32m[INFO]: TensorRT installing ...\033[0m"
sudo dpkg -i $tensorrt_fn
sudo apt-key add /var/nv-tensorrt-repo-ubuntu2004-cuda11.6-trt8.4.0.6-ea-20220212/7fa2af80.pub
sudo apt-get update
sudo apt-get install tensorrt -y
sudo apt-get install python3-libnvinfer-dev -y

sudo rm $cuda_fn
sudo rm $cudnn_fn
sudo rm $tensorrt_fn

参考文献
SpireCV-SDK:https://docs.amovlab.com/Spire_CV_Amov


http://www.kler.cn/a/229372.html

相关文章:

  • C#,图片分层(Layer Bitmap)绘制,反色、高斯模糊及凹凸贴图等处理的高速算法与源程序
  • 浅谈云计算03 | 云计算的技术支撑(云使能技术)
  • FFmpeg开发笔记(七)欧拉系统编译安装FFmpeg
  • 【make】makefile 函数全解
  • C++并发编程之跨应用程序与驱动程序的单生产者单消费者队列
  • 为AI聊天工具添加一个知识系统 之32 三“中”全“会”:推理式的ISA(父类)和IOS(母本)以及生成式CMN (双亲委派)之1
  • 解决Linux Shell脚本错误:“/bin/bash^M: bad interpreter: No such file or directory”
  • java执行可执行文件
  • kafka-splunk数据通路实践
  • Java注解与策略模式的奇妙结合:Autowired探秘
  • 算法学习——LeetCode力扣哈希表篇1
  • 在WebGL中创建动画
  • 深入解析Elasticsearch的内部数据结构和机制:行存储、列存储与倒排索引之行存(一)
  • Dijkstra求最短路 I
  • Linux较常用的几个命令记录
  • sui move笔记
  • 总是提示安装不了tensorflow
  • 网络编程面试系列-02
  • 【方法论】费曼学习方法
  • IT行业证书的获取与价值:提升职业竞争力的关键
  • Django部署到服务器后无法获取到静态元素 The requested resource was not found on this server
  • C语言贪吃蛇详解
  • 软件系统架构的演变历史介绍
  • Windows显示空的可移动磁盘的解决方案
  • LeetCode、216. 组合总和 III【中等,组合型枚举】
  • block任务块、rescue和always、loop循环、role角色概述、role角色应用、ansible-vault、sudo提权、特殊的主机清单变量