Jetson tx2 上源码安装 pytorch1.0.0(真. 血泪史)

Jetson tx2 上源码安装 pytorch1.0.0(真. 血泪史)

本篇以在python3.5安装过程为例。在安装之前说明以下:

重点一:平台及cuda cudnn的安装问题

Jetson TX2平台版本:Jetpack 3.3, cuda 9.0.252, cudnn7.1.5, TensorRT4.0.2, python2.7/python3.5

系统内核:tegra-ubuntu 4.4.38-tegra aarch64

Linux系统版本:Ubuntu16.04,cmake 3.15.6 (TX2刷机完原始的cmake是3.5.1版本,由于后面自己捣鼓的时候说最好安装3.9.0以上版本cmake,所以我就直接升级到新版本了)

在源码安装pytorch的时候会使用到cuda及cudnn,首先检查自己Jetson TX2上的cuda cudnn 是不是从jetpack安装的,如果不是那么就需要注意了!!!Jetson TX2的CPU是基于ARM的,所以安装的cuda及cudnn都必须是ARM版本的(即aarch64),Jetson TX2上cuda及cudnn的安装可以参考这篇:Jetson TX2 安装 cuda9.0 及 cudnn7 超详细(真实亲测


重点二:pytorch源码下载问题

1、pytorch不同版本对应着不同cuda版本
  1. 在pytorch的github上直接下载的是最新版的pytorch,本文写于2020.1.14,现在使用
git clone  http://github.com/pytorch/pytorch  

下载得到的是 pytorch 1.4.0a0,想要安装这个版本的pytorch需要的平台需要安装cuda9.2及以上,对于我现在的平台是不匹配的,pytorch与cuda的对应可以在pytorch的官网上找到:

pytorch版本与cuda的对应可以参考pytorch官网:
pytorch历史版本:https://pytorch.org/get-started/previous-versions/
pytorch最新版本:https://pytorch.org/get-started/locally/

如果你的平台跟我的一样,那么我推荐 pytorch1.0.0版本。怎么才能下载到自己想要版本的pytorch呢?建议大家好看这个链接:如何下载自己想要版本的pytorch

2、pytorch github源码中的third_party文件夹是链接没有文件

在pytorch github上,文件夹里面虽然显示是有内容的,但是其实是相关子项目链接,直接下载pytorch源码是不能将第三方库一起下载下来的。所以,在下载pytorch的时候需要注意。推荐使用下面的命令下载:

git clone --recursive --branch v1.0.0 http://github.com/pytorch/pytorch

一定要加上 --recursive 用于循环克隆git子项目

重点三:We should turn-off NCCL support since it is only available on the desktop GPU.

见 https://devtalk.nvidia.com/default/topic/1042821/jetson-tx2/pytorch-install-broken/
在编译中出现下面的错误,就是因为没有关闭 NCCL,具体的关闭方法下面会讲到

nvlink error : entry function '_Z28ncclAllReduceLLKernel_sum_i88ncclColl' with max regcount of 80 calls function '_Z25ncclReduceScatter_max_u64P14CollectiveArgs' with regcount of 96
nvlink error : entry function '_Z29ncclAllReduceLLKernel_sum_i328ncclColl' with max regcount of 80 calls function '_Z25ncclReduceScatter_max_u64P14CollectiveArgs' with regcount of 96
nvlink error : entry function '_Z29ncclAllReduceLLKernel_sum_f168ncclColl' with max regcount of 80 calls function '_Z25ncclReduceScatter_max_u64P14CollectiveArgs' with regcount of 96
nvlink error : entry function '_Z29ncclAllReduceLLKernel_sum_u328ncclColl' with max regcount of 80 calls function '_Z25ncclReduceScatter_max_u64P14CollectiveArgs' with regcount of 96
nvlink error : entry function '_Z29ncclAllReduceLLKernel_sum_f328ncclColl' with max regcount of 80 calls function '_Z25ncclReduceScatter_max_u64P14CollectiveArgs' with regcount of 96
nvlink error : entry function '_Z29ncclAllReduceLLKernel_sum_u648ncclColl' with max regcount of 80 calls function '_Z25ncclReduceScatter_max_u64P14CollectiveArgs' with regcount of 96
nvlink error : entry function '_Z28ncclAllReduceLLKernel_sum_u88ncclColl' with max regcount of 80 calls function
  • 1
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值