linux编译zstd源码,编译pytorch源码

本文档详细记录了在Linux环境下从源码编译PyTorch的过程,包括克隆源码、切换到特定版本、更新第三方库、创建虚拟环境、安装依赖、编译设置和验证安装。在编译过程中,特别强调了CUDA和cudatoolkit的重要性,并解决了编译完成后在VSCode中调试时遇到的问题。
摘要由CSDN通过智能技术生成

编译pytorch源码

clone pytorch源码:

(base) xueruini@nico2:~/onion_rain/pytorch/code$ git clone --recursive https://github.com/pytorch/pytorch

Cloning into 'pytorch'...

remote: Enumerating objects: 37, done.

remote: Counting objects: 100% (37/37), done.

...

Resolving deltas: 100% (151/151), done.

Submodule path 'third_party/tensorpipe/third_party/pybind11/tools/clang': checked out '6a00cbc4a9b8e68b71caf7f774b3f9c753ae84d5'

Submodule path 'third_party/zstd': checked out 'aec56a52fbab207fc639a1937d1e708a282edca8'

(base) xueruini@nico2:~/onion_rain/pytorch/code$ cd pytorch

(base) xueruini@nico2:~/onion_rain/pytorch/code/pytorch$ ls

android aten.bzl binaries c10 CITATION CMakeLists.txt CODEOWNERS docker docker.Makefile ios Makefile mypy.ini README.md scripts submodules third_party torch version.txt

aten benchmarks BUILD.bazel caffe2 cmake CODE_OF_CONDUCT.md CONTRIBUTING.md Dockerfile docs LICENSE modules NOTICE requirements.txt setup.py test tools ubsan.supp WORKSPACE

切换到release版本

(pytorch) xueruini@nico2:~/onion_rain/pytorch/code/pytorch$ git checkout v1.5.1

Checking out files: 100% (3139/3139), done.

Note: checking out 'v1.5.1'.

You are in 'detached HEAD' state. You can look around, make experimental

changes and commit them, and you can discard any commits you make in this

state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may

do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 3c31d73

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值