Im trying to install stable diffusion bur im dumb

Asfat: <p>excuse me I’m trying to install stable diffusion currently, however i know nothing about python and have encountered and error while installing through the  webui.user.bat</p>
<p>AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDINE_ARGS variable to disable this check</p>
<p>does anyone have an idea on how to fix it or what may be causing the issue. if you do please explain in a idiot friendly way</p>

ptrblck: <p>I assume this might be the first time you are trying to install or use PyTorch?<br>
If so, first of all welcome! Could you try to run a quick smoke test to see if you’ve installed the right PyTorch version with CUDA support e.g via:</p>
<pre><code class="lang-python">python -c "import torch; print(torch.randn(1).cuda())"
</code></pre>
<p>If this returns an error, your installation doesn’t support your GPU and we would need to figure out why.</p>
<p>Could you then post the output of <code>python -m torch.utils.collect_env</code> here by wrapping it into three backticks ```?</p>
<p>Also, which install command were you using to install the PyTorch binaries?</p>

neekfenwick: <p>I got this message also, since I’m running with an AMD RX6800 graphics card which doesn’t have CUDA.  I’m following the guide at <a href="https://stablediffusionguides.carrd.co/#one" class="inline-onebox" rel="noopener nofollow ugc">Arki's Stable Diffusion Guides</a>. If you look in webui-user.bat you should see a line that looks like this:</p>
<pre><code>set COMMANDLINE_ARGS=
</code></pre>
<p>The message is telling you to change the line to this:</p>
<pre><code>set COMMANDLINE_ARGS=--skip-torch-cuda-test
</code></pre>
<p>This then successfully sets the project up and runs the web UI. Unfortunately, txt2img then fails with:<br>
"RuntimeError: “LayerNormKernelImpl” not implemented for ‘Half’</p>
<p>This seems to be something to do with not having CUDA, but I don’t see what to do about it <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"> Damn scalpers, I’ve have bought nvidia if they were available.</p>

yschen0474: <p>Hi, I ran into the same problem too. I followed this tutorial (<a href="https://bit.ly/3Cq3vJB" class="inline-onebox" rel="noopener nofollow ugc">Tutorial: CUDA, cuDNN, Anaconda, Jupyter, PyTorch Installation in Windows 10 | by Sik-Ho Tsang | Medium</a>) to install CUDA, cuDNN, Anaconda, Jupyter, PyTorch, but webui.user.bat still gave the same error</p>
<p>AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDINE_ARGS variable to disable this check</p>
<p>Running the line <code>python -c "import torch; print(torch.randn(1).cuda())"</code> returns:</p>
<pre><code class="lang-auto">tensor([0.4252], device='cuda:0')
</code></pre>
<p>and <code>python -m torch.utils.collect_env</code> returns:</p>
<pre><code class="lang-auto">PyTorch version: 1.12.1
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 10 Home
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.12 (main, Apr  4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19044-SP0
Is CUDA available: True
CUDA runtime version: 11.7.99
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3080 Ti
Nvidia driver version: 517.48
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cudnn_ops_train64_8.dll
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.5
[pip3] numpydoc==1.2
[pip3] torch==1.12.1
[pip3] torchaudio==0.12.1
[pip3] torchvision==0.13.1
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               11.3.1               h59b6b97_2
[conda] mkl                       2021.4.0           haa95532_640
[conda] mkl-service               2.4.0            py39h2bbff1b_0
[conda] mkl_fft                   1.3.1            py39h277e83a_0
[conda] mkl_random                1.2.2            py39hf11a4ad_0
[conda] numpy                     1.21.5           py39h7a0a035_1
[conda] numpy-base                1.21.5           py39hca35cd5_1
[conda] numpydoc                  1.2                pyhd3eb1b0_0
[conda] pytorch                   1.12.1          py3.9_cuda11.3_cudnn8_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.12.1               py39_cu113    pytorch
[conda] torchvision               0.13.1               py39_cu113    pytorch
</code></pre>
<p>I think my GPU is capable to be used by Torch. What have I done wrong?</p>

neekfenwick: <p>I agree with your basic assertion that your GPU seems CUDA capable, and I guess Torch ought to be able to use it … but, since you get that error message about adding “–skip-torch-cuda-test to COMMANDINE_ARGS” … have you tried doing this?  I mentioned how to do this in webui-user.bat in my post above.  I’m very much a n00b in this software and hardware and have fallen at the first post, but it’s the only thing I can suggest that you apparently haven’t tried <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>

AlphaBetaGamma96: <p>Hi <a class="mention" href="/u/neekfenwick">@neekfenwick</a>,</p>
<p>How did you install torch? Did you install it with ROCm instead of CUDA in the <a href="https://pytorch.org/get-started/locally/" class="inline-onebox" rel="noopener nofollow ugc">Start Locally | PyTorch</a> page? Beacuse I think torch refers to any GPU device via <code>cuda</code> even if its <code>ROCm</code> (correct me if I’m wrong <a class="mention" href="/u/ptrblck">@ptrblck</a>)</p>
<aside class="quote no-group" data-username="neekfenwick" data-post="3" data-topic="162263">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/neekfenwick/48/53569_2.png" class="avatar"> neekfenwick:</div>
<blockquote>
<p>This then successfully sets the project up and runs the web UI. Unfortunately, txt2img then fails with:<br>
"RuntimeError: “LayerNormKernelImpl” not implemented for ‘Half’</p>
</blockquote>
</aside>
<p>I don’t think this is CUDA related because the <code>LayerNormKernellmpl</code> function is using some pytorch op which only supports <code>float32</code> or <code>float64</code> and not <code>float16</code> aka <code>half</code>. So, can you share what this <code>LayerNormKernelImpl</code> function is?</p>
<p>You can run your code within a <code>torch.autograd.set_detect_anomaly</code> context manager, and it’ll point to the line that’s causing the issue.</p>

yschen0474: <p>Hi <a class="mention" href="/u/neekfenwick">@neekfenwick</a>,</p>
<p>Somehow adding only <code>--skip-torch-cuda-test</code> is not enough for my first run, so instead I added <code>--lowvram --precision full --no-half --skip-torch-cuda-test</code> to make it work. But the program works with only <code>--skip-torch-cuda-test</code> now.</p>
<p>In case of error like <code>RuntimeError: "log" "_vml_cpu" not implemented for 'Half'</code>, add <code>--precision full --no-half</code> to COMMANDINE_ARGS.</p>