Skip to content

[Bug]: 1000+ LoRAs crash - "Too many file descriptors in select" #10001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
MrKuenning opened this issue May 1, 2023 · 5 comments
Closed
1 task done

[Bug]: 1000+ LoRAs crash - "Too many file descriptors in select" #10001

MrKuenning opened this issue May 1, 2023 · 5 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@MrKuenning
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

After updating to the latest WebUI, viewing my LoRA models crashes the console.

Steps to reproduce the problem

  1. Start A1111
  2. Press the extra networks button
  3. UI Hangs

What should have happened?

It should have loaded the models.

Commit where the problem happens

72cd27a

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--listen --port 7799 --api --xformers --enable-insecure-extension-access --disable-safe-unpickle --styles-file styles-full.csv

List of extensions

I have disabled the extensions for troubleshooting purposes.

Console logs

Exception in thread Thread-295 (run):
Traceback (most recent call last):
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
    self.run_forever()
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
    self._run_once()
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1860, in _run_once
    event_list = self._selector.select(timeout)
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 324, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 315, in _select
    r, w, x = select.select(r, w, w, timeout)
ValueError: too many file descriptors in select()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "E:\AI\A1111\venv\lib\site-packages\uvicorn\server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 47, in run
    _cancel_all_tasks(loop)
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 63, in _cancel_all_tasks
    loop.run_until_complete(tasks.gather(*to_cancel, return_exceptions=True))
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
    self.run_forever()
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
    self._run_once()
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1860, in _run_once
    event_list = self._selector.select(timeout)
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 324, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "C:\Users\Brady\AppData\Local\Programs\Python\Python310\lib\selectors.py", line 315, in _select
    r, w, x = select.select(r, w, w, timeout)
ValueError: too many file descriptors in select()

Additional information

I have about 1300 LoRAs. They used to load just fine prior to updating.
I did make sure that Torch and Xformers got updated as well.
I also disabled all extensions.

@MrKuenning MrKuenning added the bug-report Report of a bug, yet to be confirmed label May 1, 2023
@MrKuenning
Copy link
Author

MrKuenning commented May 1, 2023

I have found that if I remove most of the LoRA files, open extra networks, and then add all of the LoRAs back and hit refresh.
It will load them all in just fine. But If I leave them all in the first time I load the extra networks, it crashes.

@MrKuenning MrKuenning changed the title [Bug]: Too many file descriptors in select [Bug]: 1300 LoRAs crash - Too many file descriptors in select May 2, 2023
@MrKuenning MrKuenning changed the title [Bug]: 1300 LoRAs crash - Too many file descriptors in select [Bug]: 1000+ LoRAs crash - "Too many file descriptors in select" May 2, 2023
@ClashSAN
Copy link
Collaborator

ClashSAN commented May 2, 2023

See if you can help with troubleshooting/testing this PR:
#8742

@MrKuenning
Copy link
Author

Thanks for the ideas. That PR says its not working after the latest update. And I am not sure where to start with the python windows 64 sockets limit. Is that something I can change in the base Python config, or do I need to find the line in the webUI that's making the call and limit it there?

There is something that changed in the latest webUI update this week that caused this. As I used to have about 1500 models with no errors at all, and now I get crashes when I have over 800.

There doesn't seem to be any rhyme or reason to which models. Just a high number causes the UI to just crash when I open the extra networks.

@MrKuenning
Copy link
Author

This has been resolved with the latest updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

4 participants
@MrKuenning @w-e-w @ClashSAN and others