• aarch64 arm64 部署 stable diffusion webui 笔记 【1】准备 venv 安装pytorch 验证cuda


    aarch64 pytorch(没有aarch64对应版本,自行编译)

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

    创建venv

    [root@ceph3 stable-diffusion-webui]# /usr/local/Python-3.10.12/bin/python3 -m venv venv

    [root@ceph3 stable-diffusion-webui]# source venv/bin/activate
    (venv)[root@ceph3 stable-diffusion-webui]# 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
    Traceback (most recent call last):
      File "", line 1, in
    ModuleNotFoundError: No module named 'torch'
    >>> 

    发现torch未安装到venv,

    安装pyyaml

    (venv) [root@ceph3 stable-diffusion-webui]# cd /home/yeqiang/pyyaml-6.0.1/
    (venv) [root@ceph3 pyyaml-6.0.1]# python3 setup.py install
    日志

    1. (venv) [root@ceph3 pyyaml-6.0.1]# python3 setup.py install
    2. running install
    3. /home/yeqiang/stable-diffusion-webui/venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    4. warnings.warn(
    5. /home/yeqiang/stable-diffusion-webui/venv/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
    6. warnings.warn(
    7. running bdist_egg
    8. running egg_info
    9. writing lib/PyYAML.egg-info/PKG-INFO
    10. writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
    11. writing top-level names to lib/PyYAML.egg-info/top_level.txt
    12. reading manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
    13. reading manifest template 'MANIFEST.in'
    14. warning: no files found matching 'README'
    15. adding license file 'LICENSE'
    16. writing manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
    17. installing library code to build/bdist.linux-aarch64/egg
    18. running install_lib
    19. running build_py
    20. running build_ext
    21. building 'yaml._yaml' extension
    22. gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/yeqiang/stable-diffusion-webui/venv/include -I/usr/local/Python-3.10.12/include/python3.10 -c yaml/_yaml.c -o build/temp.linux-aarch64-cpython-310/yaml/_yaml.o
    23. gcc: 错误:yaml/_yaml.c:没有那个文件或目录
    24. gcc: 致命错误:没有输入文件
    25. 编译中断。
    26. Error compiling module, falling back to pure Python
    27. creating build/bdist.linux-aarch64/egg
    28. creating build/bdist.linux-aarch64/egg/yaml
    29. copying build/lib.linux-aarch64-cpython-310/yaml/__init__.py -> build/bdist.linux-aarch64/egg/yaml
    30. copying build/lib.linux-aarch64-cpython-310/yaml/composer.py -> build/bdist.linux-aarch64/egg/yaml
    31. copying build/lib.linux-aarch64-cpython-310/yaml/constructor.py -> build/bdist.linux-aarch64/egg/yaml
    32. copying build/lib.linux-aarch64-cpython-310/yaml/cyaml.py -> build/bdist.linux-aarch64/egg/yaml
    33. copying build/lib.linux-aarch64-cpython-310/yaml/dumper.py -> build/bdist.linux-aarch64/egg/yaml
    34. copying build/lib.linux-aarch64-cpython-310/yaml/emitter.py -> build/bdist.linux-aarch64/egg/yaml
    35. copying build/lib.linux-aarch64-cpython-310/yaml/error.py -> build/bdist.linux-aarch64/egg/yaml
    36. copying build/lib.linux-aarch64-cpython-310/yaml/events.py -> build/bdist.linux-aarch64/egg/yaml
    37. copying build/lib.linux-aarch64-cpython-310/yaml/loader.py -> build/bdist.linux-aarch64/egg/yaml
    38. copying build/lib.linux-aarch64-cpython-310/yaml/nodes.py -> build/bdist.linux-aarch64/egg/yaml
    39. copying build/lib.linux-aarch64-cpython-310/yaml/parser.py -> build/bdist.linux-aarch64/egg/yaml
    40. copying build/lib.linux-aarch64-cpython-310/yaml/reader.py -> build/bdist.linux-aarch64/egg/yaml
    41. copying build/lib.linux-aarch64-cpython-310/yaml/representer.py -> build/bdist.linux-aarch64/egg/yaml
    42. copying build/lib.linux-aarch64-cpython-310/yaml/resolver.py -> build/bdist.linux-aarch64/egg/yaml
    43. copying build/lib.linux-aarch64-cpython-310/yaml/scanner.py -> build/bdist.linux-aarch64/egg/yaml
    44. copying build/lib.linux-aarch64-cpython-310/yaml/serializer.py -> build/bdist.linux-aarch64/egg/yaml
    45. copying build/lib.linux-aarch64-cpython-310/yaml/tokens.py -> build/bdist.linux-aarch64/egg/yaml
    46. creating build/bdist.linux-aarch64/egg/_yaml
    47. copying build/lib.linux-aarch64-cpython-310/_yaml/__init__.py -> build/bdist.linux-aarch64/egg/_yaml
    48. byte-compiling build/bdist.linux-aarch64/egg/yaml/__init__.py to __init__.cpython-310.pyc
    49. byte-compiling build/bdist.linux-aarch64/egg/yaml/composer.py to composer.cpython-310.pyc
    50. byte-compiling build/bdist.linux-aarch64/egg/yaml/constructor.py to constructor.cpython-310.pyc
    51. byte-compiling build/bdist.linux-aarch64/egg/yaml/cyaml.py to cyaml.cpython-310.pyc
    52. byte-compiling build/bdist.linux-aarch64/egg/yaml/dumper.py to dumper.cpython-310.pyc
    53. byte-compiling build/bdist.linux-aarch64/egg/yaml/emitter.py to emitter.cpython-310.pyc
    54. byte-compiling build/bdist.linux-aarch64/egg/yaml/error.py to error.cpython-310.pyc
    55. byte-compiling build/bdist.linux-aarch64/egg/yaml/events.py to events.cpython-310.pyc
    56. byte-compiling build/bdist.linux-aarch64/egg/yaml/loader.py to loader.cpython-310.pyc
    57. byte-compiling build/bdist.linux-aarch64/egg/yaml/nodes.py to nodes.cpython-310.pyc
    58. byte-compiling build/bdist.linux-aarch64/egg/yaml/parser.py to parser.cpython-310.pyc
    59. byte-compiling build/bdist.linux-aarch64/egg/yaml/reader.py to reader.cpython-310.pyc
    60. byte-compiling build/bdist.linux-aarch64/egg/yaml/representer.py to representer.cpython-310.pyc
    61. byte-compiling build/bdist.linux-aarch64/egg/yaml/resolver.py to resolver.cpython-310.pyc
    62. byte-compiling build/bdist.linux-aarch64/egg/yaml/scanner.py to scanner.cpython-310.pyc
    63. byte-compiling build/bdist.linux-aarch64/egg/yaml/serializer.py to serializer.cpython-310.pyc
    64. byte-compiling build/bdist.linux-aarch64/egg/yaml/tokens.py to tokens.cpython-310.pyc
    65. byte-compiling build/bdist.linux-aarch64/egg/_yaml/__init__.py to __init__.cpython-310.pyc
    66. creating build/bdist.linux-aarch64/egg/EGG-INFO
    67. copying lib/PyYAML.egg-info/PKG-INFO -> build/bdist.linux-aarch64/egg/EGG-INFO
    68. copying lib/PyYAML.egg-info/SOURCES.txt -> build/bdist.linux-aarch64/egg/EGG-INFO
    69. copying lib/PyYAML.egg-info/dependency_links.txt -> build/bdist.linux-aarch64/egg/EGG-INFO
    70. copying lib/PyYAML.egg-info/top_level.txt -> build/bdist.linux-aarch64/egg/EGG-INFO
    71. zip_safe flag not set; analyzing archive contents...
    72. creating 'dist/PyYAML-6.0.1-py3.10-linux-aarch64.egg' and adding 'build/bdist.linux-aarch64/egg' to it
    73. removing 'build/bdist.linux-aarch64/egg' (and everything under it)
    74. Processing PyYAML-6.0.1-py3.10-linux-aarch64.egg
    75. Copying PyYAML-6.0.1-py3.10-linux-aarch64.egg to /home/yeqiang/stable-diffusion-webui/venv/lib/python3.10/site-packages
    76. Adding PyYAML 6.0.1 to easy-install.pth file
    77. Installed /home/yeqiang/stable-diffusion-webui/venv/lib/python3.10/site-packages/PyYAML-6.0.1-py3.10-linux-aarch64.egg
    78. Processing dependencies for PyYAML==6.0.1
    79. Finished processing dependencies for PyYAML==6.0.1

    安装typing_extensions

    (venv) [root@ceph3 yeqiang]# python3 -m pip install /home/yeqiang/typing_extensions-4.7.1-py3-none-any.whl 
    Processing ./typing_extensions-4.7.1-py3-none-any.whl
    Installing collected packages: typing-extensions
    Successfully installed typing-extensions-4.7.1
     

    venv内安装编译好的pytorch

    (venv) [root@ceph3 ~]# cd /home/yeqiang/pytorch
    (venv) [root@ceph3 pytorch]# export PATH=/usr/local/cmake-3.27.4-linux-aarch64/bin:$PATH
    (venv) [root@ceph3 pytorch]# python3 setup.py install
    当前成果

    pip list显示torch未2.0.0a0,实际上是在v2.0.1分支上编译的。

    安装import torch需要的依赖

    (venv) [root@ceph3 stable-diffusion-webui]# cd /home/yeqiang/pytorch-libs/
    (venv) [root@ceph3 pytorch-libs]# 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 /home/yeqiang/stable-diffusion-webui/venv/lib/python3.10/site-packages (from filelock==3.12.3) (4.7.1)
    Installing collected packages: mpmath, sympy, networkx, MarkupSafe, filelock, Jinja2
    Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.3 filelock-3.12.3 mpmath-1.3.0 networkx-3.1 sympy-1.12

    [notice] A new release of pip is available: 23.0.1 -> 23.2.1
    [notice] To update, run: pip install --upgrade pip
     

    验证venv内的torch+cuda

    其他依赖安装待续。

  • 相关阅读:
    12个C语言必背实例
    从智能家到智慧家!一字之差看到三翼鸟落地差异化
    解决vue-servlet数据传输时出现的跨域问题
    BufferPool缓存机制
    java中分割字符串总结 - 超级无敌详细版本。不仅要熟悉各种方法还要做到灵活运用。
    RESTFul风格接口如何设计
    Debezium系列之:深入理解Kafka的消息代理
    F - Sorting a Matrix(拓扑&缩点)
    基于Android的学生管理系统App设计与实现(Eclipse开发)
    Locust 断言的实现?
  • 原文地址:https://blog.csdn.net/hknaruto/article/details/132693794