"git@developer.sourcefind.cn:jerrrrry/infinicore.git" did not exist on "8f710be1452c1af700dd3f96c7e9fb6d9ee7c6ca"
Commit c0705977 authored by wangkaixiong's avatar wangkaixiong 🚴🏼
Browse files

init

parent d3982d85
version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.8"
sphinx:
configuration: docs/zh_cn/conf.py
# fail_on_warning: true
# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf
python:
install:
- requirements: docs/requirements.txt
Template for the Read the Docs tutorial
=======================================
This GitHub template includes fictional Python library
with some basic Sphinx docs.
Read the tutorial here:
https://docs.readthedocs.io/en/stable/tutorial/
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = zh_cn
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 540589faaaa841b2311606a5f824605f
tags: 645f666f9bcd5a90fca523b33c5a78b7
<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>1 基于Anaconda的DCU使用示例: &mdash; DCU 0.2.0 文档</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/copybutton.css" type="text/css" />
<link rel="stylesheet" href="_static/css/readthedocs.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/translations.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="索引" href="genindex.html" />
<link rel="search" title="搜索" href="search.html" />
<link rel="next" title="hy-smi 使用介绍" href="Hy-SMI.html" />
<link rel="prev" title="3 DCU基础环境完整教程-ubuntu:" href="install_dcu_on_os/ubuntu.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
DCU
</a>
<div class="version">
0.2.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="搜索文档" aria-label="搜索文档" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="导航菜单">
<p class="caption" role="heading"><span class="caption-text">基础介绍</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">操作系统版本兼容列表</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#dcu">支持的DCU型号</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#id2">DCU软件介绍:</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#id3"><strong>兼容性(必读)</strong></a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">资源下载地址</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="download.html">下载中心:</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">构建DCU基础环境</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/base_install_intro.html">1. 开发者社区 DCU 环境安装手册</a></li>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/centos.html"><strong>2 DCU基础环境完整教程-Centos7.6</strong>:</a></li>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/ubuntu.html"><strong>3 DCU基础环境完整教程-ubuntu</strong>:</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">快速使用 DCU</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">1 基于Anaconda的DCU使用示例:</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#anaconda">1.1. 安装Anaconda;</a></li>
<li class="toctree-l2"><a class="reference internal" href="#dcupytorchresnet50">1.2. 使用DCU在Pytorch推理Resnet50分类</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#pip">1.2.1. 创建虚拟环境, 设置pip下载源为国内:</a></li>
<li class="toctree-l3"><a class="reference internal" href="#torchtorchvision">1.2.2. 从开发者社区的下载torch、torchvision;</a></li>
<li class="toctree-l3"><a class="reference internal" href="#resetnet50">1.2.3. 执行resetnet50分类的推理代码:</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#dockerdcu">2 基于Docker使用DCU</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#docker">2.1. 安装Docker</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id1">2.2. 启动容器</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id2">2.2.1. 前置条件</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">2.2.2. 拉取镜像</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id4">2.2.3. 启动容器命令</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id5">2.3. 基于容器执行resetnet50分类的推理代码</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#torch">2.3.1. 验证<code class="docutils literal notranslate"><span class="pre">torch</span></code>是否安装成功;</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id6">2.3.2. 执行resetnet50分类的推理代码:</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">hy-smi 使用介绍</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Hy-SMI.html">hy-smi 使用介绍</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">从NV的GPU迁移到DCU</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="NV_GPU_TO_DCU.html">1 从NV的GPU迁移到DCU</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="移动版导航菜单" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">DCU</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="页面导航">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">1 基于Anaconda的DCU使用示例:</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/Anaconda_Docker.md.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="anacondadcu">
<h1>1 基于Anaconda的DCU使用示例:<a class="headerlink" href="#anacondadcu" title="此标题的永久链接"></a></h1>
<section id="anaconda">
<h2>1.1. 安装Anaconda;<a class="headerlink" href="#anaconda" title="此标题的永久链接"></a></h2>
<p><a class="reference external" href="https://www.anaconda.com/download">Anaconda地址</a></p>
</section>
<section id="dcupytorchresnet50">
<h2>1.2. 使用DCU在Pytorch推理Resnet50分类<a class="headerlink" href="#dcupytorchresnet50" title="此标题的永久链接"></a></h2>
<section id="pip">
<h3>1.2.1. 创建虚拟环境, 设置pip下载源为国内:<a class="headerlink" href="#pip" title="此标题的永久链接"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>conda<span class="w"> </span>create<span class="w"> </span>-n<span class="w"> </span>dcu_test<span class="w"> </span><span class="nv">python</span><span class="o">=</span><span class="m">3</span>.10
conda<span class="w"> </span>activate<span class="w"> </span>dcu_test
pip3<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>global.index-url<span class="w"> </span>https://pypi.tuna.tsinghua.edu.cn/simple
</pre></div>
</div>
</section>
<section id="torchtorchvision">
<h3>1.2.2. 从开发者社区的下载torch、torchvision;<a class="headerlink" href="#torchtorchvision" title="此标题的永久链接"></a></h3>
<p><a class="reference external" href="https://cancon.hpccube.com:65024/4/main/"><strong>DAS生态包下载地址</strong></a></p>
<ol class="arabic">
<li><p>下载torch、torchvision的whl文件到本地;</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">*.whl</span></code>;</p></li>
<li><p>验证<code class="docutils literal notranslate"><span class="pre">torch</span></code>是否安装成功;</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-c<span class="w"> </span><span class="s2">&quot;import torch;print(torch.cuda.is_available());print(torch.cuda.device_count())&quot;</span>
</pre></div>
</div>
</li>
</ol>
</section>
<section id="resetnet50">
<h3>1.2.3. 执行resetnet50分类的推理代码:<a class="headerlink" href="#resetnet50" title="此标题的永久链接"></a></h3>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>http://developer.hpccube.com/codes/wangkx1/torch_inference_resnet50.git
<span class="nb">cd</span><span class="w"> </span>torch_inference_resnet50
python<span class="w"> </span>torch_verify.py
</pre></div>
</div>
</section>
</section>
</section>
<section id="dockerdcu">
<h1>2 基于Docker使用DCU<a class="headerlink" href="#dockerdcu" title="此标题的永久链接"></a></h1>
<p>DCU开发者社区光源镜像介绍:</p>
<p><a class="reference external" href="https://sourcefind.cn/#/service-list">https://sourcefind.cn/#/service-list</a></p>
<p>光源可以查询到基于多种DTK版本的安装的深度学习基础镜像、大模型推理框架(vllm、lmdeploy、fastllm等)镜像、通用模型推理框架镜像(migraphx、AITemplate等)镜像;</p>
<section id="docker">
<h2>2.1. 安装Docker<a class="headerlink" href="#docker" title="此标题的永久链接"></a></h2>
<p>参考当前操作系统的版本号,自行安装docker</p>
<p>查看当前操作系统版本号:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cat<span class="w"> </span>/etc/os-release
</pre></div>
</div>
</section>
<section id="id1">
<h2>2.2. 启动容器<a class="headerlink" href="#id1" title="此标题的永久链接"></a></h2>
<p>基于镜像创建的容器可提供开箱即用的基于DCU的深度学习运行环境:</p>
<section id="id2">
<h3>2.2.1. 前置条件<a class="headerlink" href="#id2" title="此标题的永久链接"></a></h3>
<ol class="arabic simple">
<li><p>安装DCU加速卡,并完成其对应驱动的安装;</p></li>
<li><p>正确安装docker;</p></li>
</ol>
</section>
<section id="id3">
<h3>2.2.2. 拉取镜像<a class="headerlink" href="#id3" title="此标题的永久链接"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>pull<span class="w"> </span>image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.0-ubuntu20.04-dtk24.04.1-py3.8
</pre></div>
</div>
</section>
<section id="id4">
<h3>2.2.3. 启动容器命令<a class="headerlink" href="#id4" title="此标题的永久链接"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span><span class="se">\</span>
--network<span class="o">=</span>host<span class="w"> </span><span class="se">\</span>
--ipc<span class="o">=</span>host<span class="w"> </span><span class="se">\</span>
--shm-size<span class="o">=</span>16G<span class="w"> </span><span class="se">\</span>
--device<span class="o">=</span>/dev/kfd<span class="w"> </span><span class="se">\</span>
--device<span class="o">=</span>/dev/mkfd<span class="w"> </span><span class="se">\</span>
--device<span class="o">=</span>/dev/dri<span class="w"> </span><span class="se">\</span>
-v<span class="w"> </span>/opt/hyhal:/opt/hyhal<span class="w"> </span><span class="se">\</span>
-v<span class="w"> </span>your_path:/workspace<span class="w"> </span><span class="se">\</span>
--group-add<span class="w"> </span>video<span class="w"> </span><span class="se">\</span>
--cap-add<span class="o">=</span>SYS_PTRACE<span class="w"> </span><span class="se">\</span>
--security-opt<span class="w"> </span><span class="nv">seccomp</span><span class="o">=</span>unconfined<span class="w"> </span><span class="se">\</span>
--name<span class="o">=</span>dcu_test<span class="w"> </span><span class="se">\</span>
image.sourcefind.cn:5000/dcu/admin/base/pytorch:1.0-ubuntu20.04-dtk24.04.1-py3.8<span class="w"> </span><span class="se">\</span>
/bin/bash
注:<span class="w"> </span>
(1)若出现libhsa-runtime相关报错,启动参数请加上-v<span class="w"> </span>/opt/hyhal:/opt/hyhal*;若物理机无/opt/hyhal,请下载hyhal并解压放置容器/opt/下;*
(2)参数解释:
<span class="w"> </span>-it<span class="w"> </span><span class="c1"># i:打开容器标准输入,t:分配一个伪终端</span>
<span class="w"> </span>--network<span class="o">=</span>host<span class="w"> </span><span class="c1"># 连接网络(none|host|自定义网络...)</span>
<span class="w"> </span>--ipc<span class="o">=</span>host<span class="w"> </span><span class="c1"># 设置IPC模式(none|shareable|host...)</span>
<span class="w"> </span>--shm-size<span class="o">=</span>24G<span class="w"> </span><span class="c1"># 设置/dev/shm大小</span>
<span class="w"> </span>--device<span class="o">=</span>/dev/kfd<span class="w"> </span><span class="c1"># 指定访问设备(DCU需要添加/dev/kfd、/dev/mkfd、/dev/dri)</span>
<span class="w"> </span>--device<span class="o">=</span>/dev/mkfd
<span class="w"> </span>--device<span class="o">=</span>/dev/dri
<span class="w"> </span>-v<span class="w"> </span>/opt/hyhal:/opt/hyhal<span class="w"> </span><span class="c1"># dtk23.10以上版本镜像需要-v挂载物理机目录/opt/hyhal</span>
<span class="w"> </span>-v<span class="w"> </span>your_path:/workspace<span class="w"> </span><span class="c1"># 挂载工作目录</span>
<span class="w"> </span>--group-add<span class="w"> </span>video<span class="w"> </span><span class="c1"># 设置用户附加组(普通用户使用DCU需要)</span>
<span class="w"> </span>--cap-add<span class="o">=</span>SYS_PTRACE<span class="w"> </span><span class="c1"># 添加权限(SYS_PTRACE|NET_ADMIN...)</span>
<span class="w"> </span>--security-opt<span class="w"> </span><span class="nv">seccomp</span><span class="o">=</span>unconfined<span class="w"> </span><span class="c1"># 安全配置(seccomp=unconfined|label=disable...)</span>
<span class="w"> </span>--name<span class="o">=</span>dcu_test<span class="w"> </span><span class="c1"># 容器名称</span>
<span class="w"> </span>image.sourcefind.cn:5000/dcu/admin/base/custom:alphafold2-2.3.2-dtk23.10-py38<span class="w"> </span><span class="c1"># 所需镜像</span>
<span class="w"> </span>/bin/bash<span class="w"> </span><span class="c1"># 容器内启动bash</span>
</pre></div>
</div>
</section>
</section>
<section id="id5">
<h2>2.3. 基于容器执行resetnet50分类的推理代码<a class="headerlink" href="#id5" title="此标题的永久链接"></a></h2>
<section id="torch">
<h3>2.3.1. 验证<code class="docutils literal notranslate"><span class="pre">torch</span></code>是否安装成功;<a class="headerlink" href="#torch" title="此标题的永久链接"></a></h3>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>```shell
python -c &quot;import torch;print(torch.cuda.is_available());print(torch.cuda.device_count())&quot;
```
</pre></div>
</div>
<p>如果不可用, 从开<a class="reference external" href="https://cancon.hpccube.com:65024/4/main/">发者社区</a>下载安装torch等你需要的深度学习依赖包;</p>
<ol class="arabic simple">
<li><p>下载torch、torchvision的whl文件到本地;</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">*.whl</span></code>;</p></li>
</ol>
</section>
<section id="id6">
<h3>2.3.2. 执行resetnet50分类的推理代码:<a class="headerlink" href="#id6" title="此标题的永久链接"></a></h3>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>http://developer.hpccube.com/codes/wangkx1/torch_inference_resnet50.git
<span class="nb">cd</span><span class="w"> </span>torch_inference_resnet50
python<span class="w"> </span>torch_verify.py
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="页脚">
<a href="install_dcu_on_os/ubuntu.html" class="btn btn-neutral float-left" title="3 DCU基础环境完整教程-ubuntu:" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
<a href="Hy-SMI.html" class="btn btn-neutral float-right" title="hy-smi 使用介绍" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; 版权所有 2024-now, DCU User.</p>
</div>
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用的
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a> 开发.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>hy-smi 使用介绍 &mdash; DCU 0.2.0 文档</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/copybutton.css" type="text/css" />
<link rel="stylesheet" href="_static/css/readthedocs.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/translations.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="索引" href="genindex.html" />
<link rel="search" title="搜索" href="search.html" />
<link rel="next" title="1 从NV的GPU迁移到DCU" href="NV_GPU_TO_DCU.html" />
<link rel="prev" title="1 基于Anaconda的DCU使用示例:" href="Anaconda_Docker.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
DCU
</a>
<div class="version">
0.2.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="搜索文档" aria-label="搜索文档" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="导航菜单">
<p class="caption" role="heading"><span class="caption-text">基础介绍</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">操作系统版本兼容列表</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#dcu">支持的DCU型号</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#id2">DCU软件介绍:</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#id3"><strong>兼容性(必读)</strong></a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">资源下载地址</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="download.html">下载中心:</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">构建DCU基础环境</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/base_install_intro.html">1. 开发者社区 DCU 环境安装手册</a></li>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/centos.html"><strong>2 DCU基础环境完整教程-Centos7.6</strong>:</a></li>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/ubuntu.html"><strong>3 DCU基础环境完整教程-ubuntu</strong>:</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">快速使用 DCU</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Anaconda_Docker.html">1 基于Anaconda的DCU使用示例:</a></li>
<li class="toctree-l1"><a class="reference internal" href="Anaconda_Docker.html#dockerdcu">2 基于Docker使用DCU</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">hy-smi 使用介绍</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">hy-smi 使用介绍</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">hy-smi 命令输出介绍</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">常用用法:</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">更多用法</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">从NV的GPU迁移到DCU</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="NV_GPU_TO_DCU.html">1 从NV的GPU迁移到DCU</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="移动版导航菜单" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">DCU</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="页面导航">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">hy-smi 使用介绍</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/Hy-SMI.md.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="hy-smi">
<h1>hy-smi 使用介绍<a class="headerlink" href="#hy-smi" title="此标题的永久链接"></a></h1>
<section id="id1">
<h2>hy-smi 命令输出介绍<a class="headerlink" href="#id1" title="此标题的永久链接"></a></h2>
<p>系统终端输入<code class="docutils literal notranslate"><span class="pre">hy-smi</span></code>得到如下输出:</p>
<p><img alt="hy-smi输出" src="_images/hy_smi.png" /></p>
<p>输出内容的每一列的说明</p>
<ul class="simple">
<li><p>DCU:0-7 是卡的序号索引</p></li>
<li><p>Temp:DCU卡当前运行的温度</p></li>
<li><p>AvgPwr:平均功耗</p></li>
<li><p>Perf:运行的性能模式</p></li>
<li><p>PwrCap:额定功耗</p></li>
<li><p>VARM%:显存占用率</p></li>
<li><p>DCU%:核心利用率</p></li>
<li><p>Mode:默认模式即为<code class="docutils literal notranslate"><span class="pre">Normal</span></code>,不建议设置其他模式(会影响性能)。</p></li>
</ul>
</section>
<section id="id2">
<h2>常用用法:<a class="headerlink" href="#id2" title="此标题的永久链接"></a></h2>
<ul class="simple">
<li><p>查看显卡名字:<code class="docutils literal notranslate"><span class="pre">hy-smi</span> <span class="pre">--showproductname</span></code></p></li>
<li><p>查看当前DCU卡上运行进程占用的资源情况:<code class="docutils literal notranslate"><span class="pre">hy-smi</span> <span class="pre">--showpids</span></code></p></li>
<li><p>查看指定进程在DCU卡上的资源占用情况: <code class="docutils literal notranslate"><span class="pre">hy-smi</span> <span class="pre">--showpiddcus</span></code></p></li>
<li><p>查看驱动版本号:<code class="docutils literal notranslate"><span class="pre">hy-smi</span> <span class="pre">--showdriverversion</span></code></p></li>
<li><p>查看<code class="docutils literal notranslate"><span class="pre">vbios</span></code>版本号:<code class="docutils literal notranslate"><span class="pre">hy-smi</span> <span class="pre">-v</span></code></p></li>
<li><p>查看具体显存占用情况: <code class="docutils literal notranslate"><span class="pre">hy-smi</span> <span class="pre">--showmeminfo</span> <span class="pre">vram</span></code></p></li>
</ul>
</section>
<section id="id3">
<h2>更多用法<a class="headerlink" href="#id3" title="此标题的永久链接"></a></h2>
<p>更多用法请使用 <code class="docutils literal notranslate"><span class="pre">hy-smi</span> <span class="pre">-h</span></code>查看学习使用;</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="页脚">
<a href="Anaconda_Docker.html" class="btn btn-neutral float-left" title="1 基于Anaconda的DCU使用示例:" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
<a href="NV_GPU_TO_DCU.html" class="btn btn-neutral float-right" title="1 从NV的GPU迁移到DCU" accesskey="n" rel="next">下一页 <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; 版权所有 2024-now, DCU User.</p>
</div>
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用的
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a> 开发.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>1 从NV的GPU迁移到DCU &mdash; DCU 0.2.0 文档</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/copybutton.css" type="text/css" />
<link rel="stylesheet" href="_static/css/readthedocs.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/translations.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="索引" href="genindex.html" />
<link rel="search" title="搜索" href="search.html" />
<link rel="prev" title="hy-smi 使用介绍" href="Hy-SMI.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
DCU
</a>
<div class="version">
0.2.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="搜索文档" aria-label="搜索文档" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="导航菜单">
<p class="caption" role="heading"><span class="caption-text">基础介绍</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="get_started.html">操作系统版本兼容列表</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#dcu">支持的DCU型号</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#id2">DCU软件介绍:</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.html#id3"><strong>兼容性(必读)</strong></a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">资源下载地址</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="download.html">下载中心:</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">构建DCU基础环境</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/base_install_intro.html">1. 开发者社区 DCU 环境安装手册</a></li>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/centos.html"><strong>2 DCU基础环境完整教程-Centos7.6</strong>:</a></li>
<li class="toctree-l1"><a class="reference internal" href="install_dcu_on_os/ubuntu.html"><strong>3 DCU基础环境完整教程-ubuntu</strong>:</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">快速使用 DCU</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Anaconda_Docker.html">1 基于Anaconda的DCU使用示例:</a></li>
<li class="toctree-l1"><a class="reference internal" href="Anaconda_Docker.html#dockerdcu">2 基于Docker使用DCU</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">hy-smi 使用介绍</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Hy-SMI.html">hy-smi 使用介绍</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">从NV的GPU迁移到DCU</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">1 从NV的GPU迁移到DCU</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#dcu">1.1. 构建DCU基础环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id1">1.2. 替换深度学习算法包</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">1.3. DCU 适配案例:</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="移动版导航菜单" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">DCU</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="页面导航">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">1 从NV的GPU迁移到DCU</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/NV_GPU_TO_DCU.md.txt" rel="nofollow"> 查看页面源码</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="nvgpudcu">
<h1>1 从NV的GPU迁移到DCU<a class="headerlink" href="#nvgpudcu" title="此标题的永久链接"></a></h1>
<section id="dcu">
<h2>1.1. 构建DCU基础环境<a class="headerlink" href="#dcu" title="此标题的永久链接"></a></h2>
<p>参考第一部分 <code class="docutils literal notranslate"><span class="pre">构建DCU基础环境</span></code>, 完成 DCU 基础环境构建</p>
</section>
<section id="id1">
<h2>1.2. 替换深度学习算法包<a class="headerlink" href="#id1" title="此标题的永久链接"></a></h2>
<p>对于依赖cuda的深度学习算法包,需要替换为光合开发者社区的版本;</p>
<p>开发者社区:<a class="reference external" href="https://developer.hpccube.com/tool">https://developer.hpccube.com/tool</a>
<img alt="AI生态包下载地址" src="_images/das.png" /></p>
<!-- <center><img src="./imgs/das.png" alt="AI生态包下载地址" style="zoom:50%;" /></center> -->
<p><strong>手动下载其中对应算法包的whl文件到您的服务器,安装轮子</strong></p>
<p>参考如下步骤:</p>
<blockquote>
<div><p>注意: 替换算法包的时候,算法包的版本需要和DTK对应;</p>
</div></blockquote>
<ol class="arabic simple">
<li><p>pip 配置国内安装源</p></li>
</ol>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip3<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>global.index-url<span class="w"> </span>https://pypi.tuna.tsinghua.edu.cn/simple
pip<span class="w"> </span>install<span class="w"> </span>pip<span class="w"> </span>-U
</pre></div>
</div>
<ol class="arabic simple" start="2">
<li><p>安装轮子</p></li>
</ol>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>***.whl<span class="w"> </span>
</pre></div>
</div>
</section>
<section id="id2">
<h2>1.3. DCU 适配案例:<a class="headerlink" href="#id2" title="此标题的永久链接"></a></h2>
<p><strong>DCU开发者社区光源ModelZoo介绍</strong>(可以快速查询所需的DCU算法模型,根据Readme进行构建DCU环境,一键运行所需的算法模型):</p>
<p><a class="reference external" href="https://sourcefind.cn/#/model-zoo/list">https://sourcefind.cn/#/model-zoo/list</a></p>
<p>光源可以查询到基于多种DCU适配的各个AI技术领域的算法模型以及算法框架,如bert、yolo、resnet、Qwen、Llama、vllm、lmdpeloy等等;</p>
<p><strong>Examples:</strong></p>
<ul class="simple">
<li><p><a class="reference external" href="https://sourcefind.cn/#/model-zoo/1802637886774013954">YOLOv10</a></p></li>
<li><p><a class="reference external" href="https://sourcefind.cn/#/model-zoo/1805170476575846402">Rep_Vit</a></p></li>
<li><p><a class="reference external" href="https://sourcefind.cn/#/model-zoo/1712346117256200194">alphafold2_jax</a></p></li>
<li><p><a class="reference external" href="https://sourcefind.cn/#/model-zoo/1782218524112154626">llama3</a></p></li>
<li><p><a class="reference external" href="https://sourcefind.cn/#/model-zoo/1793173002231443458">stablediffusion_v2.1</a></p></li>
<li><p><a class="reference external" href="https://sourcefind.cn/#/model-zoo/1793160576505180161">Qwen1.5</a></p></li>
</ul>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="页脚">
<a href="Hy-SMI.html" class="btn btn-neutral float-left" title="hy-smi 使用介绍" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> 上一页</a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; 版权所有 2024-now, DCU User.</p>
</div>
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用的
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
<a href="https://readthedocs.org">Read the Docs</a> 开发.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment