pytorch-v2.0.1 cuda arm64 aarch64 torch 2.0.1+cu118 源码编译笔记【2】验证cuda安装 成功

接上篇

pytorch-v2.0.1 cuda arm64 aarch64 torch 2.0.1+cu118 源码编译笔记_hkNaruto的博客-CSDN博客

由于采用/usr/local/bin/gcc编译,先设置LD_LIBRARY_PATH,再启动python3

export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib
/usr/local/Python-3.10.12/bin/python3

import torch报错

/usr/local/Python-3.10.12/bin/python3

Python 3.10.12 (main, Sep 4 2023, 10:01:29) [GCC 9.2.0] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import torch

No sympy found

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/init.py", line 1465, in <module>

from . import _meta_registrations

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_meta_registrations.py", line 7, in <module>

from torch._decomp import _add_op_to_registry, global_decomposition_table, meta_table

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_decomp/init.py", line 169, in <module>

import torch._decomp.decompositions

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_decomp/decompositions.py", line 10, in <module>

import torch._prims as prims

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_prims/init.py", line 33, in <module>

from torch._subclasses.fake_tensor import FakeTensor, FakeTensorMode

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_subclasses/init.py", line 3, in <module>

from torch._subclasses.fake_tensor import (

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_subclasses/fake_tensor.py", line 13, in <module>

from torch._guards import Source

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_guards.py", line 78, in <module>

class ShapeGuard(NamedTuple):

File "/usr/local/Python-3.10.12/lib/python3.10/site-packages/torch/_guards.py", line 79, in ShapeGuard

expr: sympy.Expr
NameError: name 'sympy' is not defined

安装sympy

在线

/usr/local/Python-3.10.12/bin/python3 -m pip install sympy

离线

[root@ceph3 pytorch-libs]# /usr/local/Python-3.10.12/bin/python3 -m pip install *.whl
Processing ./filelock-3.12.3-py3-none-any.whl
Processing ./Jinja2-3.1.2-py3-none-any.whl
Processing ./MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Processing ./mpmath-1.3.0-py3-none-any.whl
Processing ./networkx-3.1-py3-none-any.whl
Processing ./sympy-1.12-py3-none-any.whl
Requirement already satisfied: typing-extensions>=4.7.1 in /usr/local/Python-3.10.12/lib/python3.10/site-packages (from filelock==3.12.3) (4.7.1)
mpmath is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
sympy is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
Installing collected packages: networkx, MarkupSafe, filelock, Jinja2
Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.3 filelock-3.12.3 networkx-3.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 23.2.1
[notice] To update, run: /usr/local/Python-3.10.12/bin/python3 -m pip install --upgrade pip

import torch成功,测试cuda是否可用

参考:

PyTorch快速安装并验证GPU是否可用_pytorch测试gpu_ai_patch的博客-CSDN博客

相关推荐
上海合宙LuatOS43 分钟前
直接抄作业!Air780E模组LuatOS开发:位运算(bit)示例
人工智能·单片机·嵌入式硬件·物联网·硬件工程·iot
池央1 小时前
深度学习模型:卷积神经网络(CNN)
人工智能·深度学习·cnn
deephub1 小时前
Scikit-learn Pipeline完全指南:高效构建机器学习工作流
人工智能·python·机器学习·scikit-learn
知来者逆1 小时前
首次公开用系统审查与评估大语言模型安全性的数据集
人工智能·机器学习·语言模型·自然语言处理·llm·大语言模型
HyperAI超神经2 小时前
NeurIPS 2024 有效投稿达 15,671 篇,数据集版块内容丰富
人工智能·开源·自动驾驶·数据集·多模态·化学光谱·neurips 2024
uhakadotcom3 小时前
AI搜索引擎的尽头是电商?从perplexity开始卖货说起...
前端·人工智能·后端
KeKe_L3 小时前
深度学习—参数初始化及激活函数Day35
人工智能·深度学习
谢白羽3 小时前
CUDA补充笔记
笔记
醉陌离3 小时前
渗透测试笔记—shodan(7完结)
笔记
virtaitech3 小时前
探索 GAN 的演变之路
人工智能·神经网络·生成对抗网络