Fixed- Torch is not able to use GPU AMD Stable Diffusion --skip-torch-cuda-test (AUTOMATIC1111) Bug

StuffAboutStuff
15 Jan 202404:10

TLDRThe video script offers a solution for users encountering a runtime error when running the web UI-user dobat file for stable, diffusion with AMD support. It guides viewers to edit configuration files, upgrade pip, and install necessary packages to resolve the issue. The steps are designed to help users successfully build and run stable, diffusion with or without ONNX and Olive support, and the video encourages feedback and subscription for more AI and technology content.

Takeaways

  • 🛠️ Update the stable, diffusion build following the latest video instructions to avoid runtime errors.
  • 💻 If encountering a GPU-related error with torch, add `torch D direct ml` to the command line arguments.
  • 📂 Locate and edit the `requirements.txt` and `web_ui-user-dobat` files in the stable, diffusion folder.
  • 🖋️ Append `torch D direct ml` at the end of `requirements.txt` and add `D- use-direct ml` to the command line arguments in `web_ui-user-dobat`.
  • 🚀 Run the environment activation command `V back SL scriptsackslash activate` from the command prompt with admin privileges.
  • 🔄 Upgrade pip using the command `python.exe -m pip install --upgrade pip` to ensure a successful build process.
  • 📦 Install httpx with the command `pip install httpx==0.241` to address the requirements.
  • 🔧 Execute `pip install -r requirements.txt` to install necessary packages for stable, diffusion.
  • 🌐 Launch the stable, diffusion web interface by running the modified `web_ui-user-dobat` file.
  • 🎯 If building with ONNX and OpenVINO support, add `D-nnx` to the command line arguments.
  • 📢 Seek help in the comments section if the procedure does not work, and share success with a thumbs up or comment.

Q & A

  • What is the main issue discussed in the video?

    -The main issue discussed is a runtime error encountered when running the web ui-user dobat file for building stable, diffusion with AMD support, which started around mid-December due to a repo reversion to CUDA.

  • How can one fix the error with Torch not being able to use the GPU?

    -To fix the error, add `torch + direct ml` to your command line arguments before running the web ui-user dobat file. This will force the use of direct ml.

  • What are the two files that need to be edited to resolve the issue?

    -The two files that need to be edited are `requirements.txt` and `web ui-user dobat` file.

  • What should be added to the `requirements.txt` file to fix the issue?

    -At the bottom of the `requirements.txt` file, you should add `torch direct ml` and then save the file.

  • What changes should be made to the `web ui-user dobat` file?

    -In the `web ui-user dobat` file, add `-use-direct-ml` to the command line arguments to force the use of direct ml.

  • What is the next step after editing the files?

    -After editing the files, open a command prompt in admin mode, navigate to the stable, diffusion folder, and execute the command to activate the environment.

  • How can you ensure that the environment is activated successfully?

    -The environment is activated successfully when it shows in brackets at the bottom left hand corner of the command prompt window.

  • What command should be executed to upgrade pip?

    -To upgrade pip, execute the command `python.exe -m pip install --upgrade pip`.

  • Which package is recommended to install after upgrading pip?

    -After upgrading pip, it is recommended to install the package `httpx` with the command `pip install httpx==0.241`.

  • What is the final step to build stable, diffusion?

    -The final step is to execute the command `pip install -r requirements.txt` to install the necessary requirements and build stable, diffusion on your PC.

  • What should you do if the web ui-user dobat file compiles and builds successfully?

    -If the file compiles and builds successfully, it should launch your browser and open the stable, diffusion web interface, indicating a functioning stable, diffusion setup.

  • How can viewers provide feedback on the video?

    -Viewers can provide feedback by leaving a comment, giving a thumbs up, or subscribing to the channel for future AI and technology videos.

Outlines

00:00

💻 Fixing GPU Error in Stable Diffusion Build

The paragraph discusses a common issue faced when building Stable Diffusion with AMD support, where an error occurs when running the web UI using a .bat file. The error is related to Torch not being able to use the GPU. The video provides a solution to this problem by suggesting the addition of specific command-line arguments to bypass the CUDA test. It also mentions that the issue might be resolved in the future and advises viewers to follow the steps carefully to avoid the error.

Mindmap

Keywords

💡stable diffusion

Stable diffusion is a term used in the context of machine learning and AI to describe a type of generative model that can create new images or modify existing ones. In the video, it refers to a specific software or tool that the user is trying to build or run on their computer. The main theme revolves around troubleshooting and optimizing this tool for better performance.

💡AMD support

AMD support refers to the compatibility of a software or hardware with products manufactured by Advanced Micro Devices, Inc. In this context, it indicates that the stable diffusion tool being discussed is designed to work with AMD graphics cards.

💡runtime error

A runtime error is an error that occurs during the execution of a program. It is different from a compile-time error, which occurs while the code is being compiled. Runtime errors can be caused by various issues, such as incorrect user input, software bugs, or hardware problems.

💡CUDA

CUDA, or Compute Unified Device Architecture, is a parallel computing platform and programming model developed by NVIDIA. It allows developers to use NVIDIA GPUs for general purpose processing, which can significantly speed up computations. In the video, CUDA is mentioned in the context of GPU support for stable diffusion.

💡command line arguments

Command line arguments are parameters passed to a program or command via the command line interface (CLI). They are used to modify the behavior of the program or to provide it with additional data. In the context of the video, the user is instructed to add specific arguments to the command line to resolve an error and optimize the performance of stable diffusion.

💡requirements.txt

A requirements.txt file is a common way to list the dependencies of a Python project. It contains a list of packages and their versions required for the project to run properly. In the video, the user is guided to edit this file as part of the troubleshooting process for stable diffusion.

💡web UI-user dobat

The web UI-user dobat likely refers to a batch file (.bat) used to run a web user interface for the stable diffusion software. Batch files are scripts that contain a series of commands to be executed by the command line interpreter in Windows.

💡direct ml

DirectML is a feature of the Windows operating system that allows applications to harness the power of machine learning models directly on the GPU. It is used to improve performance and efficiency when running machine learning tasks.

💡ONNX

ONNX, or Open Neural Network Exchange, is an open standard format designed to represent deep learning models. It allows AI developers to move models between different frameworks and tools, facilitating the use of pre-trained models across various platforms.

💡Olive

Olive is a term used in the video, but without additional context, it's difficult to define precisely. It could potentially refer to a specific feature, tool, or framework related to AI or machine learning that is compatible with stable diffusion.

💡pip

Pip is a package installer for Python that allows users to install and manage additional packages or libraries. It is a crucial tool for Python developers as it simplifies the process of setting up the necessary dependencies for a project.

💡httpx

Httpx is an HTTP protocol library for Python that is used to make asynchronous HTTP requests. It is designed to be a modern replacement for the popular 'requests' library and supports HTTP/2, which can improve the performance of network operations.

Highlights

Introduction to building stable, diffusion with AMD support.

Addressing a common runtime error when running the web UI-user dobat file.

The error may be resolved in future updates to the repo.

Instructions based on a previous build video.

Editing the 'requirements_uncore_version.txt' file to add 'torch D direct ml'.

Modifying the 'web ui-user dobat' file to force the use of direct ml.

Running the setup natively or with ONNX and OpenVINO support.

Opening Windows Explorer to locate the stable, diffusion config files.

Executing admin mode command prompt and changing directory to the stable, diffusion folder.

Activating the environment and upgrading pip.

Installing httpx with a specific version (0.241).

Executing the command to install requirements from 'requirements.txt'.

Compiling and building stable diffusion on your PC.

Launching the browser and accessing the stable, diffusion web interface upon successful build.

Providing a solution for users experiencing issues with their stable, diffusion build.

Invitation for feedback on the procedure in the comments section.

Encouragement to subscribe for future AI and technology videos.