Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

`tcgetpgrp failed: Not a tty` after running python entry_with_update.py to start the software

Open wakywayne opened this issue 1 year ago • 3 comments

Read Troubleshoot

I admit that I have read the Troubleshoot before making this issue.

Describe the problem When running python entry_with_update.py in a WSL Unbuntu Linux instance I am unable to get my http window to work it says bad request in the browser and "tcgetpgrp failed: Not a tty" in my Linux terminal.

Full Console Log

Already up-to-date
Update succeeded.
[System ARGV] ['entry_with_update.py']
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
Fooocus version: 2.1.859
Running on local URL:  http://127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
Total VRAM 4096 MB, total RAM 7819 MB
Trying to enable lowvram mode because your GPU seems to have 4GB or less. If you don't want this use: --always-normal-vram
Set vram state to: LOW_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce GTX 1650 Ti with Max-Q Design : native
VAE dtype: torch.float32
Using pytorch cross attention
tcgetpgrp failed: Not a tty
Refiner unloaded.
model_type EPS
UNet ADM Dimension 2816
Killed

wakywayne avatar Dec 31 '23 22:12 wakywayne

I think you are running into WSL specific issues. You may be able to get around it by exporting the browser before starting as stated here.

if that doesn't work, I'd try it directly on windows and not in WSL.

eddyizm avatar Dec 31 '23 23:12 eddyizm

@eddyizm The browser is being opened it just isn't loading the request. I get the:

This page isn’t working127.0.0.1 sent an invalid response. ERR_INVALID_HTTP_RESPONSE

I tried setting my BROWSER variable, but I am not sure if I did it right. Here is what I did in my .bashrc file:

export BROWSER=C:\Program Files\Google\Chrome\Application\chrome.exe

also, why do we even need the browser aren't we offline anyway?

wakywayne avatar Jan 01 '24 23:01 wakywayne

I think you should switch to installing and trying to run it on windows directly. The 127.0.0.1 address is your local host (your computer), it is how you interact with the application, eg via a browser, unless you interact with it via the command line or api this is how it works.

That being said, that address is not the same for WSL as it is for bare windows, there's several hoops you need to jump through in order to access apps being served from within WSL to the host machine because WSL is working like a virtual machine.

As I mentioned earlier, this is not a Fooocus issue. I believe your export is wrong as well because that path is not the same in WSL, it would be something like /mnt/c/program files etc and you could need quotes.

I use WSL2 on windows as well but there is no need or benefit to use that over running Fooocus directly on windows. I would start over and try to follow the windows install instructions.

eddyizm avatar Jan 01 '24 23:01 eddyizm

@eddyizm Thanks for taking the time to help me I am just going to take your advice. How should I uninstall from my WSL so I don't waist the space.

wakywayne avatar Jan 02 '24 03:01 wakywayne

No problem. How did you install it in wsl? Did you just do a git clone ? Just remove that folder, the models are all downloaded into that folder, eg the juggernaut model by default which is about 6.45 GB. You could move that into your windows install if you are comfy doing it that way.

eddyizm avatar Jan 02 '24 03:01 eddyizm

@eddyizm Thank you so much for your help I didn't want to give up just yet so can you tell me if this path seems right in my .bashrc file: export BROWSER ='/mnt/c/Program Files/Google/Chrome/Application/chrome_proxy.exe'

The browser is giving the same issue, but my terminal now shows: UNet ADM Dimension 2816

Is it something to do with program files since it is two words? I wanted to give a solid effort to updating the path as I imagine this could be something I need in the future.

wakywayne avatar Jan 02 '24 19:01 wakywayne

The two words should be ok but use double quotes. Also I'd verify that it is chrome_proxy.exe that seems wrong, shouldn't it be chrome.exe ?

Lastly, did you see this comment on SO?

eddyizm avatar Jan 02 '24 20:01 eddyizm

I also would like to see if anyone has run this successfully on wsl. Perhaps there is something we are missing.

eddyizm avatar Jan 02 '24 20:01 eddyizm

@eddyizm After changing the export to this: export BROWSER="/mnt/c/'Program Files'/Google/Chrome/Application/chrome.exe"

I got a totally new error: Did I accidentally delete files? Already up-to-date Update succeeded. [System ARGV] ['entry_with_update.py'] Traceback (most recent call last): File "/home/wakywayne/utils/Fooocus/entry_with_update.py", line 46, in <module> from launch import * File "/home/wakywayne/utils/Fooocus/launch.py", line 24, in <module> from modules.config import path_checkpoints, path_loras, path_vae_approx, path_fooocus_expansion, \ File "/home/wakywayne/utils/Fooocus/modules/config.py", line 7, in <module> import modules.sdxl_styles File "/home/wakywayne/utils/Fooocus/modules/sdxl_styles.py", line 5, in <module> from modules.util import get_files_from_folder File "/home/wakywayne/utils/Fooocus/modules/util.py", line 6, in <module> import cv2 File "/home/wakywayne/utils/Fooocus/fooocus_env/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module> bootstrap() File "/home/wakywayne/utils/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

wakywayne avatar Jan 02 '24 20:01 wakywayne

I think you need to remove those inner single quotes. Also verify that path and file exists.

I would still advise you to run it in plain windows first, to prove your system can run it before putting an extra layer of abstraction and running it in wsl.

eddyizm avatar Jan 02 '24 21:01 eddyizm

BTW looks like there are 2 other folks who tried using wsl2. One gave up and the other looked like they succeeded

https://github.com/lllyasviel/Fooocus/issues/1675

This is your best bet.

eddyizm avatar Jan 02 '24 21:01 eddyizm

You may also have a look at this Docker PR

mashb1t avatar Jan 02 '24 22:01 mashb1t

@wakywayne currently doing issue cleanup. Is this issue still present for you or can it be closed?

mashb1t avatar Feb 22 '24 22:02 mashb1t

@mashb1t I gave up on using it with WSL I was not able to get it working

wakywayne avatar Feb 22 '24 22:02 wakywayne

@wakywayne thanks for the feedabck, sad to hear, but understandable. => Closing this issue now.

mashb1t avatar Feb 22 '24 23:02 mashb1t

@wakywayne thanks for the feedback, sad to hear, but understandable. => Closing this issue now.

mashb1t avatar Feb 22 '24 23:02 mashb1t