Open thefreemanever opened 10 months ago
i have this error too. but restart computer fix it.
As this tested on Windows 11, and had tested with below cases, and finally realized the python package or virtualenv not set properly.
First try:
sd.webui.zip
release package and start run.bat
=> get RuntimeError: Torch is not able to use GPU
cmd.exe
and test torch.cuda.is_available()
=> get Falsetourch.__version__
=> cpu
Second try:
pytorch
torch.cuda.is_available()
=> get Truetourch.__version__
=> cu117
Third try:
pytorch
and other dependenciessd.webui
directory and execute run.bat
=> get RuntimeError: Torch is not able to use GPU
Relaunch Anaconda, this time, directly test torch.cuda.is_available()
=> get True
Among these tests, get the python executable path with cuda
is available, say, import sys; print(sys.executable)
, then assign to set PYTHON=
in webui-user.bat
file.
FWIW, I get this "Torch is not able to use GPU" error for a 4090 machine with:
"Platform": "Linux-6.2.0-39-generic-x86_64-with-glibc2.35",
"nvidia_driver_version": "545.29.06",
But the same docker image works fine with on a 4090 machine with:
"Platform": "Linux-5.15.0-91-generic-x86_64-with-glibc2.35",
"nvidia_driver_version": "545.23.08",
Everything else is pretty much the same on both machines.
Not sure which (if any) of those is the cause. Note that I'm still on v1.6 though, and I'm guessing above comments are RE v1.7
ok but how do i fix this
this seems to work for me
# Download CUDA pin file
#wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
#sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
# Download CUDA repository package
#wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda-repo-wsl-ubuntu-12-4-local_12.4.0-1_amd64.deb
'''
# Update package lists
sudo apt update
# Upgrade packages
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt full-upgrade -y
sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo dpkg --configure -
sudo apt update
sudo apt install gcc-12 g++-12 gcc-13 g++-13 -y
sudo dpkg --configure -
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 --slave /usr/bin/g++ g++ /usr/bin/g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 --slave /usr/bin/g++ g++ /usr/bin/g++-13
sudo dpkg --configure -
sudo update-alternatives --config gcc
sudo dpkg --configure -
gcc --version
sudo apt install build-essential
sudo apt install libmpfr-dev libgmp3-dev libmpc-dev -y
wget http://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.gz
#tar -xf gcc-13.2.0.tar.gz
sudo dpkg --configure -
cd gcc-13.2.0
sudo dpkg --configure -
./configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-13.2.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-13.2.0
sudo dpkg --configure -
make -j3
sudo make install
sudo dpkg --configure -
/usr/local/gcc-13.2.0/bin/gcc-13.2.0 --version
sudo dpkg --configure -
# Install required packages
sudo apt install -y \
libxkbcommon0=1.6.0-1 \
fakeroot \
libalgorithm-merge-perl \
g++=4:13.2.0-7 \
cpp-x86-64-linux-gnu=4:13.2.0-7 \
g++-13>=13.2.0-11 \
g++-x86-64-linux-gnu=4:13.2.0-7 \
gcc-13>=13.2.0-11 \
gcc=4:13.2.0-7 \
gcc-x86-64-linux-gnu=4:13.2.0-7 \
libglvnd0=1.7.0-1 \
lto-disabled-list \
openjdk-17-jre-headless=17.0.10+7-1~22.04.1 \
libatk-wrapper-java-jni>=0.30.4-0ubuntu2 \
cpp=4:13.2.0-7 \
cpp-x86-64-linux-gnu=4:13.2.0-7 \
g++-13>=13.2.0-11~ \
g++-x86-64-linux-gnu=4:13.2.0-7 \
gcc-13>=13.2.0-11~ \
gcc=4:13.2.0-7 \
cpp-x86-64-linux-gnu=4:13.2.0-7 \
gcc-13>=13.2.0-11~ \
gcc-x86-64-linux-gnu=4:13.2.0-7 \
openjdk-17-jre-headless=17.0.10+7-1~22.04.1 \
libatk-wrapper-java-jni>=0.30.4-0ubuntu2
'''
# Install CUDA repository
sudo dpkg -i cuda-repo-wsl-ubuntu-12-4-local_12.4.0-1_amd64
# Copy CUDA keyring
sudo cp /var/cuda-repo-wsl-ubuntu-12-4-local/cuda-*-keyring.gpg /usr/share/keyrings/
# Update package lists
sudo apt-get update
# Install CUDA toolkit
sudo apt-get -y install cuda-toolkit-12-4
# Install pycuda (optional)
#sudo pip3 install pycuda
Checklist
What happened?
I installed A1111 yesterday and it was working fine. Today I wanted to launch it again using "bash webui.sh" command as it seems this is the way of launching it on Linux(Ubuntu) but the result is:
RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
PS: I have two 4090 GPUs:
Steps to reproduce the problem
try to install/launch on Ubuntu
What should have happened?
App should launch
What browsers do you use to access the UI ?
Mozilla Firefox
Sysinfo
sysinfo-2024-01-11-02-38.json
Console logs