{"id":139,"date":"2023-03-09T12:45:46","date_gmt":"2023-03-09T04:45:46","guid":{"rendered":"http:\/\/jemlab.cn\/?p=139"},"modified":"2023-03-12T16:21:11","modified_gmt":"2023-03-12T08:21:11","slug":"ubuntu%e4%b8%8aamd%e6%98%be%e5%8d%a1%e4%bd%bf%e7%94%a8%e7%9a%84stable-diffusion-webui%e3%80%90%e8%bd%ac%e8%bd%bd%e3%80%91","status":"publish","type":"post","link":"http:\/\/jemlab.cn\/?p=139","title":{"rendered":"Ubuntu\u4e0aAMD\u663e\u5361\u4f7f\u7528\u7684stable diffusion webui\u3010\u8f6c\u8f7d\u3011"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u672c\u6587\u73af\u5883\u4f7f\u7528\u5b9e\u4f53\u8bbe\u5907\uff0c\u663e\u5361\u662fAMD RX6800XT\u3002 <\/p>\n\n\n\n<p>\u7cfb\u7edf\u662fubuntu20.04.5 LTS \u684c\u9762\u7248\uff0c\u90e8\u7f72\u6210\u529f\u540e\u4e5f\u53ef\u4ee5\u5728\u8bc4\u8bba\u533a\u53d1\u51fa\u4f60\u7684\u663e\u5361\u578b\u53f7\u548c\u7cfb\u7edf\u3002<\/p>\n<cite><strong>\u672c\u6587\u8f6c\u8f7d\u81ea\uff1ahttps:\/\/cloud.tencent.com\/developer\/article\/2185097<\/strong><\/cite><\/blockquote>\n\n\n\n<p>\u975e\u865a\u62df\u5316\u73af\u5883\u3002\u5206\u4e2a100G\u7684\u5206\u533a\u5b89\u88c5Ubuntu\uff0c\u53ef\u4ee5\u4e0ewin\u5171\u5b58\uff01\u60f3\u7528\u54ea\u4e2a\u7cfb\u7edf\u5c31\u91cd\u542f\u5207\u6362\uff01\u6162\u6162\u770b\uff0c\u4e2d\u95f4\u6d89\u53cagit\u3001pip\u5b89\u88c5\u6162\u7684\u53ef\u4ee5\u88c5\u4e2a\u201c\u5f00\u53d1\u8005\u8fb9\u8f66\u201d\u89e3\u51b3<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%B8%80%E3%80%81%E6%9B%B4%E6%96%B0apt%E5%B9%B6%E5%AE%89%E8%A3%85%E4%B8%80%E4%BA%9B%E9%9C%80%E8%A6%81%E7%9A%84%E7%A8%8B%E5%BA%8F\"><strong>\u4e00\u3001\u66f4\u65b0apt\u5e76\u5b89\u88c5\u4e00\u4e9b\u9700\u8981\u7684\u7a0b\u5e8f<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\n\nsudo apt-get upgrade\n\nsudo apt-get install wget gnupg2 git\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%E4%BA%8C%E3%80%81%E5%AE%89%E8%A3%85amdgpu%E9%A9%B1%E5%8A%A8\"><strong>\u4e8c\u3001\u5b89\u88c5amdgpu\u9a71\u52a8<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -a -G video $LOGNAME\n\necho 'ADD_EXTRA_GROUPS=1' | sudo tee -a \/etc\/adduser.conf\n\necho 'EXTRA_GROUPS=video' | sudo tee -a \/etc\/adduser.conf\n\necho 'EXTRA_GROUPS=render' | sudo tee -a \/etc\/adduser.conf\n\nwget https:\/\/repo.radeon.com\/amdgpu-install\/22.20\/ubuntu\/focal\/amdgpu-install_22.20.50200-1_all.deb\n\nsudo apt-get install .\/amdgpu-install_22.20.50200-1_all.deb\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u66f4\u6539amd rocm\u6e90\u4e3a\uff1ahttps:\/\/repo.radeon.com\/rocm\/apt\/5.1.1 \uff08\u4e00\u5b9a\u8981\u6539\uff0c\u5f88\u91cd\u8981\uff01\uff01\uff01\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo amdgpu-install --usecase=hiplibsdk,rocm --no-dkms\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u6f2b\u957f\u7684\u7b49\u5f85&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -a -G video $LOGNAME\nsudo usermod -a -G render $LOGNAME\necho 'export PATH=$PATH:\/opt\/rocm\/bin:\/opt\/rocm\/profiler\/bin:\/opt\/rocm\/opencl\/bin' | sudo tee -a \/etc\/profile.d\/rocm.sh\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u6b64\u65f6\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u547d\u4ee4\u786e\u8ba4\u5b89\u88c5\uff086800xt\u4f1a\u663e\u793agfx1030\uff0c\u5176\u4ed6\u7684\u6211\u5c31\u4e0d\u77e5\u9053\u4e86\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rocm-smi\nsudo \/opt\/rocm\/bin\/rocminfo\nsudo \/opt\/rocm\/opencl\/bin\/clinfo\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u63a5\u7740\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install miopenkernels-gfx1030-36kdb\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u53c8\u662f\u6f2b\u957f\u7684\u7b49\u5f85&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install wget git python3 python3-venv\n\nsudo apt install python3-pip\n\nwget https:\/\/download.pytorch.org\/whl\/rocm5.1.1\/torch-1.12.1%2Brocm5.1.1-cp38-cp38-linux_x86_64.whl\n\nsudo pip install torch-1.12.1+rocm5.1.1-cp38-cp38-linux_x86_64.whl\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u5982\u679c\u51fa\u73b0read timed out\u7684\u8bdd\uff0c\u4e0a\u9762\u7684\u547d\u4ee4\u5728\u6765\u4e00\u904d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pip install torch torchvision --extra-index-url https:\/\/download.pytorch.org\/whl\/rocm5.1.1\n\nHSA_OVERRIDE_GFX_VERSION=10.3.0\n\nsudo reboot     #\u91cd\u542f\u7535\u8111\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u8fdb\u884c\u9a8c\u8bc1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3\nimport torch\ntorch.cuda.is_available()\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u8f93\u51fa\u7ed3\u679c\u4e3a True \u5373\u53ef\u4ee5\u8c03\u7528gpu \u7136\u540e\u6309CTRL+D\u9000\u51fapython<\/p>\n\n\n\n<p>\u73b0\u5728\u53ef\u4ee5\u4e0b\u8f7d\u5b89\u88c5\u672c\u4f53\u4e86\uff01\uff01<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui\n\ncd stable-diffusion-webui\n\npython3 -m venv venv\n\nsource venv\/bin\/activate\n\npython3 -m pip install --upgrade pip wheel\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u8fd9\u65f6\u5019\u5c31\u53bb\u628a\u9700\u8981\u7684\u6a21\u578b\u4ee5\u53ca\u5fc5\u8981\u6587\u4ef6\u653e\u8fdb\u5404\u4e2a\u6587\u4ef6\u5939\u5177\u4f53\u53c2\u8003\uff1ahttps:\/\/www.bilibili.com\/video\/BV1vG411E7ea<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TORCH_COMMAND='pip install torch torchvision --extra-index-url https:\/\/download.pytorch.org\/whl\/rocm5.1.1' python launch.py --precision full --no-half\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u7f51\u7edc\u95ee\u9898\uff0c\u61c2\u5f97\u90fd\u61c2\u3002\u6f2b\u957f\u7684\u7b49\u5019\u3002\u5982\u679c\u62a5\u9519\uff0c\u91cd\u590d\u4e0a\u9762\u7684\u547d\u4ee4\u3002\u76f4\u5230\u51fa\u73b0127.0.0.1:7860\u65f6\uff0c\u8bf4\u660e\u5b8c\u6210\u5b89\u88c5\u4e86\uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u5566\uff01\u4e0b\u6b21\u542f\u52a8\u53ea\u8981\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source venv\/bin\/activate\n\nTORCH_COMMAND='pip install torch torchvision --extra-index-url https:\/\/download.pytorch.org\/whl\/rocm5.1.1' python launch.py --precision full --no-half\n<\/code><\/pre>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<p>\u5269\u4f59\u6a21\u578b\u914d\u7f6e\u65b9\u9762\u63a5\u7740\u770b\uff1ahttps:\/\/www.bilibili.com\/video\/BV1vG411E7ea<\/p>\n\n\n\n<p>\u5982\u679c\u60f3\u5728A\u5361\u4e0aAI\u5b66\u4e60\u7684\u8bdd\uff08\u672a\u6d4b\u8bd5\uff09\u8bf7\u770b\uff1ahttps:\/\/www.bilibili.com\/video\/BV1H8411W7VX<\/p>\n\n\n\n<p>\u5982\u679c\u8fd8\u6709\u4e0d\u61c2\u5f97\u53ef\u4ee5\u53c2\u8003\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>https:\/\/rocmdocs.amd.com\/en\/latest\/Installation_Guide\/Installation_new.html#rocm-installation-guide-v5-0<\/li>\n\n\n\n<li>https:\/\/docs.amd.com\/bundle\/ROCm_Installation_Guidev5.0\/page\/How_To_Install_ROCm.html<\/li>\n\n\n\n<li>https:\/\/github.com\/ROCmSoftwarePlatform\/MIOpen<\/li>\n\n\n\n<li>https:\/\/www.cnblogs.com\/lllzhuang\/articles\/16083003.html<\/li>\n\n\n\n<li>https:\/\/github.com\/RadeonOpenCompute\/ROCm\/issues\/1756<\/li>\n\n\n\n<li>https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui\/wiki\/Install-and-Run-on-AMD-GPUs<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u73af\u5883\u4f7f\u7528\u5b9e\u4f53\u8bbe\u5907\uff0c\u663e\u5361\u662fAMD RX6800XT\u3002 \u7cfb\u7edf\u662fubuntu20.04.5 LTS \u684c\u9762\u7248\uff0c\u90e8\u7f72&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":147,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,4],"tags":[20,15,19],"class_list":["post-139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips","category-article","tag-stable-diffusion","tag-ubuntu","tag-19"],"_links":{"self":[{"href":"http:\/\/jemlab.cn\/index.php?rest_route=\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/jemlab.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jemlab.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jemlab.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jemlab.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=139"}],"version-history":[{"count":1,"href":"http:\/\/jemlab.cn\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":140,"href":"http:\/\/jemlab.cn\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions\/140"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/jemlab.cn\/index.php?rest_route=\/wp\/v2\/media\/147"}],"wp:attachment":[{"href":"http:\/\/jemlab.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jemlab.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jemlab.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}