NVIDIA Jetson AGX Orin源码编译安装CV-CUDA

2024-08-26 20:36

本文主要是介绍NVIDIA Jetson AGX Orin源码编译安装CV-CUDA,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目录

1  下载源码并配置

2 编译安装CV-CUDA

2.1 安装相应依赖包

2.2 升级gcc到gcc-11

2.3 build

2.4 升级cmake

2.5 再次build

2.5.1 报错 /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:

3 直接使用安装包

参考文献:


Jetson AGX Orin还没到货,先在之前的Jetson AGX Xavier上面做相关开发,我Jetson AGX Xavier上新刷的机,然后JetPack用的是5.1.3。下面记录下我在Jetson上的CV-CUDA的编译安装工作。

1  下载源码并配置

sudo apt install -y git git-lfs
git clone https://github.com/CVCUDA/CV-CUDA.git
cd CV-CUDA/
./init_repo.sh 

执行init_repo.sh之后报错

./init_repo.sh 
pre-commit must be fully configured.
Try 'sudo apt-get install -y pip shellcheck && sudo pip install pre-commit'.

那就先执行这两个命令,然后再配置

sudo apt-get install -y pip shellcheck
sudo pip install pre-commit

然后 vim .pre-commit-config.yaml 里面加入如下内容

repos:- repo: https://github.com/pre-commit/pre-commit-hooksrev: v3.4.0hooks:- id: trailing-whitespace- id: end-of-file-fixer- id: check-yaml

然后

pre-commit install

然后再次执行 ./init_repo.sh

2 编译安装CV-CUDA

2.1 安装相应依赖包

sudo apt install -y cmake ninja-build python3-dev libssl-dev patchelf

2.2 升级gcc到gcc-11

如果直接apt install gcc-11 g++-11会报下面的错误

sudo apt install gcc-11 g++-11
Reading package lists... Done
Building dependency tree... 0%
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-11
E: Unable to locate package g++-11

需要添加PPA源,然后再安装

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-11 g++-11

然后更改替代项

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 11

然后选择默认版本

sudo update-alternatives --config gcc
sudo update-alternatives --config g++

然后发现成功升级成11版本

2.3 build

mkdir build
ci/build.sh release  -DBUILD_TESTS=1 -DPYTHON_VERSIONS=3.8 -DPUBLIC_API_COMPILERS=gcc-11

发生下面的错误

ci/build.sh release  -DBUILD_TESTS=1 -DPYTHON_VERSIONS=3.8 -DPUBLIC_API_COMPILERS=gcc-11
CMake Error at CMakeLists.txt:16 (cmake_minimum_required):CMake 3.20.1 or higher is required.  You are running version 3.16.3-- Configuring incomplete, errors occurred!

2.4 升级cmake

先卸载掉之前的cmake

sudo apt-get remove cmake

然后 直接下载二进制包

Download CMake

然后

chmod 777 cmake-3.30.2-linux-aarch64.sh
./cmake-3.30.2-linux-aarch64.sh  --prefix=/usr/local
vim ~/.bashrc
export PATH=/usr/local/cmake-3.30.2-linux-aarch64/bin:$PATH
source  ~/.bashrc

2.5 再次build

ci/build.sh release  -DBUILD_TESTS=1 -DPYTHON_VERSIONS=3.8 -DPUBLIC_API_COMPILERS=gcc-11

2.5.1 报错 /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:435 |         function(_Functor&& __f)|                                                                                                                                                 ^ 
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:530 |         operator=(_Functor&& __f)|                                                                                                                                                  ^ 
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’

解决方法在

Fails on Cuda 11.6 and PyTorch 1.12 (/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:) · Issue #1491 · NVIDIA/apex · GitHub

具体就是

vim /usr/include/c++/11/bits/std_function.h 

然后把436这里的和后面531行这里的注释掉。

433       template<typename _Functor,
434                typename _Constraints = _Requires<_Callable<_Functor>>>
435         function(_Functor&& __f)
436         //noexcept(_Handler<_Functor>::template _S_nothrow_init<_Functor>())
437         : _Function_base()
438         {
439           static_assert(is_copy_constructible<__decay_t<_Functor>>::value,
440               "std::function target must be copy-constructible");
441           static_assert(is_constructible<__decay_t<_Functor>, _Functor>::value,
442               "std::function target must be constructible from the "
443               "constructor argument");
444 
445           using _My_handler = _Handler<_Functor>;
446 
447           if (_My_handler::_M_not_empty_function(__f))
448             {
449               _My_handler::_M_init_functor(_M_functor,
450                                            std::forward<_Functor>(__f));
451               _M_invoker = &_My_handler::_M_invoke;
452               _M_manager = &_My_handler::_M_manager;
453             }
454         }
528       template<typename _Functor>
529         _Requires<_Callable<_Functor>, function&>
530         operator=(_Functor&& __f)
531         //noexcept(_Handler<_Functor>::template _S_nothrow_init<_Functor>())
532         {
533           function(std::forward<_Functor>(__f)).swap(*this);
534           return *this;
535         }

然后编译就不报错了,但是编译过程中我发现,这太慢了

[167/377 4 1968.540s] Building CUDA object src/cvcuda/priv/legacy/CMakeFiles/cvcuda_legacy.dir/composite.cu.o

我直接放弃源码编译的方法,直接下载安装包试试,

3 直接使用安装包

Releases · CVCUDA/CV-CUDA · GitHub

去这里下载

然后直接

sudo apt install -y ./cvcuda-lib-0.10.1_beta-cuda11-aarch64-linux.deb ./cvcuda-dev-0.10.1_beta-cuda11-aarch64-linux.deb
sudo apt install -y ./cvcuda-python3.8-0.10.1_beta-cuda11-aarch64-linux.deb

参考文献:

ubuntu安装cmake-CSDN博客

这篇关于NVIDIA Jetson AGX Orin源码编译安装CV-CUDA的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1109618

相关文章

JAVA中安装多个JDK的方法

《JAVA中安装多个JDK的方法》文章介绍了在Windows系统上安装多个JDK版本的方法,包括下载、安装路径修改、环境变量配置(JAVA_HOME和Path),并说明如何通过调整JAVA_HOME在... 首先去oracle官网下载好两个版本不同的jdk(需要登录Oracle账号,没有可以免费注册)下载完

Java JDK1.8 安装和环境配置教程详解

《JavaJDK1.8安装和环境配置教程详解》文章简要介绍了JDK1.8的安装流程,包括官网下载对应系统版本、安装时选择非系统盘路径、配置JAVA_HOME、CLASSPATH和Path环境变量,... 目录1.下载JDK2.安装JDK3.配置环境变量4.检验JDK官网下载地址:Java Downloads

SQL server数据库如何下载和安装

《SQLserver数据库如何下载和安装》本文指导如何下载安装SQLServer2022评估版及SSMS工具,涵盖安装配置、连接字符串设置、C#连接数据库方法和安全注意事项,如混合验证、参数化查... 目录第一步:打开官网下载对应文件第二步:程序安装配置第三部:安装工具SQL Server Manageme

java使用protobuf-maven-plugin的插件编译proto文件详解

《java使用protobuf-maven-plugin的插件编译proto文件详解》:本文主要介绍java使用protobuf-maven-plugin的插件编译proto文件,具有很好的参考价... 目录protobuf文件作为数据传输和存储的协议主要介绍在Java使用maven编译proto文件的插件

Python中win32包的安装及常见用途介绍

《Python中win32包的安装及常见用途介绍》在Windows环境下,PythonWin32模块通常随Python安装包一起安装,:本文主要介绍Python中win32包的安装及常见用途的相关... 目录前言主要组件安装方法常见用途1. 操作Windows注册表2. 操作Windows服务3. 窗口操作

Visual Studio 2022 编译C++20代码的图文步骤

《VisualStudio2022编译C++20代码的图文步骤》在VisualStudio中启用C++20import功能,需设置语言标准为ISOC++20,开启扫描源查找模块依赖及实验性标... 默认创建Visual Studio桌面控制台项目代码包含C++20的import方法。右键项目的属性:

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/