• docker的conda环境中安装mindspore(CPU版本?)


    docker的conda环境中安装ms (CPU版本?)

    export PATH=/root/miniconda3/envs/GLUE/bin:$PATH

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

    conda config --set show_channel_urls yes
    pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.9.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.9.0-cp38-cp38-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple

    pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.9.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.9.0-cp38-cp38-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple

    (GLUE) root@cd163c5c74c9:~/miniconda3/envs/GLUE/bin# conda install -c conda-forge -c bioconda scglue pytorch-gpu jupyterlab
    Collecting package metadata (current_repodata.json): done
    Solving environment: done

    docker的conda环境中安装ms (CPU版本?)
    (ms19) root@0b5003cae16c:/workspace# pip install scglue pytorch-gpu jupyterlab -i https://pypi.tuna.tsinghua.edu.cn/simple

    pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.9.0/MindSpore/gpu/x86_64/cuda-10.1/mindspore_gpu-1.9.0-cp38-cp38-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
    pip 安装ms缺乏下面
    Downloading and Extracting Packages
    cudatoolkit-10.1.243 | 427.6 MB | 3
    (ms19) root@0b5003cae16c:/workspace# conda install mindspore-gpu=1.9.0 cudatoolkit=10.1 -c mindspore -c conda-forge ####用conda比较好
    No LSB modules are available.
    CUDA 10.1 is not supported on Ubuntu 20.04

    #####安装cuda11的
    pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.9.0/MindSpore/gpu/x86_64/cuda-11.1/mindspore_gpu-1.9.0-cp38-cp38-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
    conda install mindspore-gpu=1.9.0 cudatoolkit=11.1 -c mindspore -c conda-forge

    注意参考下方安装指南,添加运行所需的环境变量配置

    (ms19) root@0b5003cae16c:/workspace# echo $LD_LIBRARY_PATH
    /usr/local/nvidia/lib:/usr/local/nvidia/lib64
    (ms19) root@0b5003cae16c:/workspace#

    ./opt/conda/pkgs/cudatoolkit-10.1.243-h8cb64d8_10/lib
    ./opt/conda/envs/ms19/lib/libcublas.so.10
    ./opt/conda/lib/libcublas.so
    ./opt/conda/lib/libcublas.so.11
    ./opt/conda/lib/libcublas.so.11.5.1.109
    ./opt/conda/lib/libcublas.so
    ./opt/conda/lib/libcublas.so.11
    ./opt/conda/lib/libcublas.so.11.5.1.109
    ./opt/conda/envs/ms19/lib/libcublas.so
    ./opt/conda/envs/ms19/lib/python3.8/site-packages/nvidia/cublas/lib/libcublas.so.11
    ./opt/conda/envs/ms19/lib/libcublas.so.10.2.1.243
    ./opt/conda/envs/ms19/lib/libcublas.so.10

    [mindspore/run_check/_check_version.py:194] Cuda [‘10.1’, ‘11.1’, ‘11.6’] version(libcu*.so need by mindspore-gpu) is not found, please confirm that the path of cuda is set to the env LD_LIBRARY_PATH, or check whether the CUDA version in wheel package and the CUDA runtime in current device matches, please refer to the installation guidelines: https://www.mindspore.cn/install

    (ms19) root@0b5003cae16c:/# echo $LD_LIBRARY_PATH
    /usr/local/nvidia/lib:/usr/local/nvidia/lib64
    (ms19) root@0b5003cae16c:/#

    export LD_LIBRARY_PATH=/opt/conda/envs/ms19/lib/:$LD_LIBRARY_PATH

    ./opt/conda/envs/ms19/lib/python3.8/site-packages/nvidia_cudnn_cu11-8.5.0.96.dist-info
    ./opt/conda/envs/ms19/lib/python3.8/site-packages/nvidia_cuda_nvrtc_cu11-11.7.99.dist-info
    ./opt/conda/envs/ms19/lib/python3.8/site-packages/nvidia_cuda_runtime_cu11-11.7.99.dist-info
    ./opt/conda/envs/ms19/lib/python3.8/site-packages/nvidia
    ./opt/conda/envs/ms19/lib/python3.8/site-packages/nvidia_cublas_cu11-11.10.3.66.dist-info
    export LD_LIBRARY_PATH=/opt/conda/envs/ms19/lib/python3.8/site-packages/:$LD_LIBRARY_PATH
    这里安装ms是失败的!
    (base) root@0b5003cae16c:/# conda activate ms19
    (ms19) root@0b5003cae16c:/# uname -a
    Linux 0b5003cae16c 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    (ms19) root@0b5003cae16c:/#
    因为docker 镜像 不能装 显卡的驱动 所以GPU 版本安装不了下面安装CPU
    pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.9.0/MindSpore/cpu/x86_64/mindspore-1.9.0-cp38-cp38-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
    (ms19) root@0b5003cae16c:/# python
    Python 3.8.13 (default, Oct 21 2022, 23:50:54)
    [GCC 11.2.0] :: Anaconda, Inc. on linux
    Type “help”, “copyright”, “credits” or “license” for more information.

    import mindspore
    [ERROR] ME(28009,7ff33eaaf6c0,python):2022-11-11-13:11:45.822.587 [mindspore/ccsrc/runtime/hardware/device_context_manager.cc:46] LoadDynamicLib] Load dynamic library libmindspore_gpu failed, returns [libcudnn.so.7: cannot open shared object file: No such file or directory].
    quit()
    (ms19) root@0b5003cae16c:/# pip uninstall mindspore
    Found existing installation: mindspore 1.9.0
    Uninstalling mindspore-1.9.0:
    Would remove:
    /opt/conda/envs/ms19/bin/cache_admin
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore-1.9.0.dist-info/*
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/*
    Would not remove (might be manually added):
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/_ms_mpi.cpython-38-x86_64-linux-gnu.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libcuda_ops.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libgpu_collective.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libmpi_adapter.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libmpi_collective.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libnccl.so.2
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libnvidia_collective.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/plugin/libmindspore_gpu.so
    Proceed (Y/n)? y
    Successfully uninstalled mindspore-1.9.0
    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
    (ms19) root@0b5003cae16c:/# python
    Python 3.8.13 (default, Oct 21 2022, 23:50:54)
    [GCC 11.2.0] :: Anaconda, Inc. on linux
    Type “help”, “copyright”, “credits” or “license” for more information.
    import mindspore

    quit()
    (ms19) root@0b5003cae16c:/# pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.9.0/MindSpore/cpu/x86_64/mindspore-1.9.0-cp38-cp38-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
    Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
    Collecting mindspore1.9.0
    Using cached https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.9.0/MindSpore/cpu/x86_64/mindspore-1.9.0-cp38-cp38-linux_x86_64.whl (158.7 MB)
    Requirement already satisfied: packaging>=20.0 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore
    1.9.0) (21.3)
    Requirement already satisfied: psutil>=5.6.1 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore1.9.0) (5.9.4)
    Requirement already satisfied: pillow>=6.2.0 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore
    1.9.0) (9.3.0)
    Requirement already satisfied: numpy>=1.17.0 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore1.9.0) (1.23.4)
    Requirement already satisfied: astunparse>=1.6.3 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore
    1.9.0) (1.6.3)
    Requirement already satisfied: scipy>=1.5.2 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore1.9.0) (1.9.3)
    Requirement already satisfied: protobuf>=3.13.0 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore
    1.9.0) (3.20.1)
    Requirement already satisfied: asttokens>=2.0.4 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from mindspore1.9.0) (2.1.0)
    Requirement already satisfied: six in /opt/conda/envs/ms19/lib/python3.8/site-packages (from asttokens>=2.0.4->mindspore
    1.9.0) (1.16.0)
    Requirement already satisfied: wheel<1.0,>=0.23.0 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from astunparse>=1.6.3->mindspore1.9.0) (0.37.1)
    Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/conda/envs/ms19/lib/python3.8/site-packages (from packaging>=20.0->mindspore
    1.9.0) (3.0.9)
    Installing collected packages: mindspore
    Successfully installed mindspore-1.9.0
    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
    (ms19) root@0b5003cae16c:/#
    [GCC 11.2.0] :: Anaconda, Inc. on linux
    Type “help”, “copyright”, “credits” or “license” for more information.
    import mindspore
    [ERROR] ME(26924,7f33a41ca6c0,python):2022-11-11-13:14:25.916.924 [mindspore/ccsrc/runtime/hardware/device_context_manager.cc:46] LoadDynamicLib] Load dynamic library libmindspore_gpu failed, returns [libcudnn.so.7: cannot open shared object file: No such file or directory].
    quit()
    (ms19) root@0b5003cae16c:/# pip uninstall mindspore
    Found existing installation: mindspore 1.9.0
    Uninstalling mindspore-1.9.0:
    Would remove:
    /opt/conda/envs/ms19/bin/cache_admin
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore-1.9.0.dist-info/*
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/*
    Would not remove (might be manually added):
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/_ms_mpi.cpython-38-x86_64-linux-gnu.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libcuda_ops.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libgpu_collective.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libmpi_adapter.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libmpi_collective.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libnccl.so.2
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/libnvidia_collective.so
    /opt/conda/envs/ms19/lib/python3.8/site-packages/mindspore/lib/plugin/libmindspore_gpu.so
    Proceed (Y/n)? Y
    Successfully uninstalled mindspore-1.9.0
    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
    (ms19) root@0b5003cae16c:/#
    import mindspore
    (ms19) root@0b5003cae16c:/# python
    Python 3.8.13 (default, Oct 21 2022, 23:50:54)
    [GCC 11.2.0] :: Anaconda, Inc. on linux
    Type “help”, “copyright”, “credits” or “license” for more information.
    import mindspore
    import torch
    import scglue

  • 相关阅读:
    线性代数的学习和整理16:什么是各种空间(类型),向量空间,距离(类型)?
    点云从入门到精通技术详解100篇-基于激光雷达点云的路面破损检测
    MYSQL入门与进阶(十)
    FPGA工程师面试试题集锦111~120
    2.cuBLAS开发指南中文版--使用cuBLAS API
    Spring之aop
    黄东旭当选 CCF 数据库专业委员会、开源发展委员会、大数据专家委员会执行委员
    关于TCP建立连接时发送多次SYN的问题
    基于Python的房屋租赁管理系统(附源码)
    spring bean管理2
  • 原文地址:https://blog.csdn.net/qq_39306047/article/details/127804406