Closed mihirgarg01 closed 8 months ago
For anyone wondering why I'm using Windows Subsystem for Linux (WSL), the windows instillation wasn't working for me for some reason. Using WSL does work, but you need some setup. Specifically you need to have the correct nvidia driver and you need to be using WSL2. I also had to setup a .wslconfig file, because by default WSL only 25% of your system memory for a swap file (If your system memory is 16gb RAM, WSL allocates 4gb of swap).
wsl --install
(Defaults to downloading Ubuntu)wsl -l -v
wsl --set-version <distro name> 2
(use wsl -l -v to find your distro name)dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl -l -v
free -m
wsl --shutdown
.wslconfig
file in your home directory (Ex: C:\Users\
# Settings apply across all Linux distros running on WSL 2
# Can see memory in wsl2 with "free -m"
# Goes in windows home directory as .wslconfig
[wsl2]
# Limits VM memory to use no more than 48 GB, defaults to 50% of ram
memory=8GB
# Sets the VM to use 6 virtual processors (Amount of cores your CPU has)
processors=6
# Sets the amount of swap storage space to 8GB, default is 25% of available RAM
swap=32GB
I experienced the same issue on the latest Win11 WSL2 (Ubuntu 22.04). The solution for me was to install cuda-toolkit as described by @mihirgarg01
Read Troubleshoot
[x] I admit that I have read the Troubleshoot before making this issue.
Describe the problem Running WSL Ubuntu 22.04 (WSL Version 2) on Windows with a 1660 ti Mobile (6gb VRAM) using Python 3.10.12 Got an import error. Solved by running
sudo apt update
thensudo apt install libgl1
.Full Console Log Paste full console log here. You will make our job easier if you give a full log. File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/home/hepmihir/Fooocus/modules/async_worker.py", line 31, in worker import extras.preprocessors as preprocessors File "/home/hepmihir/Fooocus/extras/preprocessors.py", line 1, in
import cv2
File "/home/hepmihir/Fooocus/fooocus_env/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/hepmihir/Fooocus/fooocus_env/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory