--skip-torch-cuda- error first install

Conda was installed already, and in path.

Since it was previously installed it’s causing problems.
When installing Anaconda, you have the option to “Add Anaconda to my PATH environment variable.” This is not recommended because the add to PATH option appends Anaconda to PATH. When the installer appends to PATH, it does not call the activation scripts.

The error starts like this running webui.bat for first time:

AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

^ following these instructions didn’t solve it.

“Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see Managing environments — conda 22.9.0.post94+887d03470 documentation

So in the Conda directory, Conda/Envs is empty.

Instructions are to:

  • To activate an environment: # # # # conda activate myenv
  • Replace myenv with the environment name or directory path.

cd C:\Users\user\anaconda3
conda create --name newenv
conda activate newenv
(newenv) C:\Users\user\anaconda3>

^ this worked.

  • So I launch webui.bat again ( keeping the “–skip-torch-cuda-test” argument in webui-user.bat)

  • The same error…
    AssertionError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check

I try

C:\Users\user\anaconda3>conda activate python
Could not find conda environment: python
You can list all discoverable environments with conda info --envs.

conda info --envs shows

Conda environments:
base                     C:\Users\user\anaconda3
newenv                *  C:\Users\user\anaconda3\envs\newenv
  • I try changing environment variables (anaconda exists in user path)
  • add some dirs to sys path and user path
  • e.g. C:\Users\user\anaconda3\envs\newenv

To no avail.
By the way, Torch is installed already in E:\ai\stable-diffusion-webui\venv\

More of a complete traceback:

Command: "E:\ai\stable-diffusion-webui\venv\Scripts\python.exe" -c "import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'"
Error code: 1
stdout: <empty>
stderr: E:\ai\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\__init__.py:83: UserWarning: CUDA initialization: CUDA driver initialization failed, you might not have a CUDA gpu. (Triggered internally at  C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\c10\cuda\CUDAFunctions.cpp:109.)
  return torch._C._cuda_getDeviceCount() > 0

Error persists. How could I “start again” and avoid these errors?

Any ideas I will try as I am unskilled in this domain.

Please help :hugs: