{"id":40,"date":"2023-11-07T19:42:24","date_gmt":"2023-11-07T11:42:24","guid":{"rendered":"https:\/\/aixiu.shop\/?p=40"},"modified":"2023-11-14T12:39:11","modified_gmt":"2023-11-14T04:39:11","slug":"__trashed","status":"publish","type":"post","link":"https:\/\/aixiu.shop\/?p=40","title":{"rendered":"stablediffsion ubuntu \u914d\u7f6e\u6d41\u7a0b"},"content":{"rendered":"\n<h2 class=\"has-large-font-size\">stablediffsion ubuntu \u914d\u7f6e\u6d41\u7a0b<\/h2>\n\n\n\n<h2>1.\u73af\u5883\u521d\u59cb\u5316<\/h2>\n\n\n\n<p>\u5b89\u88c5ubuntu server \u7248\u672c\uff0c\u9632\u6b62\u51fa\u73b0\u5f88\u591a\u7384\u5b66\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u5b89\u88c5nvidia \u9a71\u52a8\uff0chttps:\/\/www.nvidia.cn\/geforce\/drivers\uff0c\u6839\u636e\u81ea\u5df1\u7684\u663e\u5361\u9009\u62e9\u9a71\u52a8\uff0c\u4e0b\u8f7d\uff0csudo chmod +x \u9a71\u52a8\u540d&amp; bash \u9a71\u52a8\u540d\uff0c\u5b89\u88c5\u5b8c\u6bd5\u4ee5\u540e\uff0cnvidia-smi\uff0c\u51fa\u73b0\u4e0b\u56fe\u6781\u4e3a\u6210\u529f\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"700\" height=\"529\" src=\"http:\/\/aixiu.shop\/wp-content\/uploads\/2023\/11\/image.png\" alt=\"\" class=\"wp-image-41\"\/><\/figure><\/div>\n\n\n<p class=\"has-text-align-left\">\u5b89\u88c5cuda,https:\/\/developer.nvidia.com\/cuda-toolkit-archive,\u9009\u62e9\u7b26\u5408\u81ea\u5df1\u7cfb\u7edf\u7248\u672c\u7684\u4e0b\u8f7d\uff0c\u5b89\u88c5\u4f9d\u8d56\u5e93 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sh cuda*linux.run<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u4ee5\u540e\uff0c\u914d\u7f6e\u6587\u4ef6 sudo vim ~\/.bashrc\uff0c\u5728\u6700\u540e\u52a0\u5165<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export PATH=\"$PATH:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin:\/usr\/games:\/usr\/local\/games:\/usr\/local\/cuda-12.1\/bin\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\/usr\/local\/cuda-12.1\/lib64<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>export CUDA_HOME=$CUDA_HOME:\/usr\/local\/cuda-12.1<\/code><\/pre>\n\n\n\n<p>\u4fdd\u5b58\u5e76source \u4f7f\u5176\u751f\u6548<\/p>\n\n\n\n<p>\u5b89\u88c5cudnn https:\/\/developer.nvidia.com\/rdp\/cudnn-download,\u9009\u62e9\u7b26\u5408\u81ea\u5df1\u7cfb\u7edf\u7684\u7248\u672c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -zxvf cudnn-*.tgz<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cp cuda\/lib64\/* \/usr\/local\/cuda*\/lib64\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cp cuda\/include\/* \/usr\/local\/cuda*\/include\/<\/code><\/pre>\n\n\n\n<h2>2.\u5b89\u88c5stablediffusion<\/h2>\n\n\n\n<p>\u62c9\u53d6\u4ee3\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> git clone https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui.git<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># install torch with CUDA support. See https:\/\/pytorch.org\/get-started\/locally\/ for more instructions if this fails.\ninstall torch torchvision torchaudio --index-url https:\/\/download.pytorch.org\/whl\/cu118\n\n# check if torch supports GPU; this must output \"True\". You need CUDA 11. installed for this. You might be able to use\n# a different version, but this is what I tested.\npython -c \"import torch; print(torch.cuda.is_available())\"\n\n# clone web ui and go into its directory\ngit clone https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui.git\ncd stable-diffusion-webui\n\n# clone repositories for Stable Diffusion and (optionally) CodeFormer\nmkdir repositories\ngit clone https:\/\/github.com\/CompVis\/stable-diffusion.git repositories\/stable-diffusion-stability-ai\ngit clone https:\/\/github.com\/CompVis\/taming-transformers.git repositories\/taming-transformers\ngit clone https:\/\/github.com\/sczhou\/CodeFormer.git repositories\/CodeFormer\ngit clone https:\/\/github.com\/salesforce\/BLIP.git repositories\/BLIP\nhttps:\/\/github.com\/Stability-AI\/generative-models.git repositories\/generative-models\n# install requirements of Stable Diffusion\ncurl --proto '=https' --tlsv1.2 -sSf https:\/\/sh.rustup.rs | sh\nsource $HOME\/.cargo\/env\n\npip install transformers diffusers invisible-watermark --prefer-binary\n\n# install k-diffusion\npip install git+https:\/\/github.com\/crowsonkb\/k-diffusion.git --prefer-binary\n\n# (optional) install GFPGAN (face restoration)\npip install git+https:\/\/github.com\/TencentARC\/GFPGAN.git --prefer-binary\n\n# (optional) install requirements for CodeFormer (face restoration)\npip install -r repositories\/CodeFormer\/requirements.txt --prefer-binary\n\n\n# install requirements of web ui\npip install -r requirements.txt  --prefer-binary\n\n# update numpy to latest version\npip install -U numpy  --prefer-binary\n\n# (outside of command line) put stable diffusion model into web ui directory\n# the command below must output something like: 1 File(s) 4,265,380,512 bytes\ndir model.ckpt\npython launch.py --force-enable-xformers --disable-nan-check --skip-python-version-check --opt-sdp-attention --xformers --api --no-half-vae --listen --port 10001<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>stablediffsion ubuntu \u914d\u7f6e\u6d41\u7a0b 1.\u73af\u5883\u521d\u59cb\u5316 \u5b89\u88c5ubuntu server \u7248\u672c\uff0c\u9632 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,2],"tags":[],"topic":[],"_links":{"self":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts\/40"}],"collection":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=40"}],"version-history":[{"count":20,"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":61,"href":"https:\/\/aixiu.shop\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions\/61"}],"wp:attachment":[{"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/aixiu.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}