painebenjamin / app.enfugue.ai

ENFUGUE is an open-source web app for making studio-grade images and video using generative AI.
GNU General Public License v3.0
686 stars 65 forks source link

Issues with jaxlib #96

Open TrainerSnow opened 1 year ago

TrainerSnow commented 1 year ago

When clicking the Enfugue button in the UI to generate the image, I get the following error message ~7 seconds afterward:

This version of jaxlib was built using AVX2 instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.

I'm on windows and used the windows zip from the releases tab.

painebenjamin commented 1 year ago

Hello @TrainerSnow,

Thank you for the bug report. To be clear, this message appears as an alter in your UI and you cannot proceed, correct? I only ask because I've seen this message and it has been innocuous before, but it's very possible that it is breaking your installation.

I am currently building v0.3 which has modified dependencies, so I can take another look at the jaxlib version. Stay tuned, release is expected on Monday.

Thanks again!

TrainerSnow commented 1 year ago

Yep, it appears in a red box in the bottom right corner. I'll let you know if 0.3 fixes the issue 👍

painebenjamin commented 1 year ago

Hello @TrainerSnow!

The dependency on a specific version of Jaxlib has been removed in v0.3. There's a possibility that it was merely covering up a different issue that will now rear it's head, but 0.3 should at least get you past this part.

It's up now on the releases page: https://github.com/painebenjamin/app.enfugue.ai/releases

coreshock commented 11 months ago

I'm also getting something similar image

coreshock commented 11 months ago

@painebenjamin Can I fix the problem above without waiting for the next Windows release? Thanks!

painebenjamin commented 11 months ago

Hello @coreshock! My apologies for the delay, I'm off on holiday this week.

Unfortunately I don't have any insight into what this error is, there is no specific usage of jaxlib in enfugue, it is a dependency of a dependency. There is some incompatibility with your environment that needs to be examined, I just need to figure out what is special about yours and OP's machines.

Could you potentially give me some more information about your environment? GPU and OS would be helpful, as well as your driver versions and anything else you're willing to volunteer.

As far as getting you up and going now, you can install via conda. Conda will analyze your machine and find a working version for your setup, it just takes a little more work to install. The documentation on the latest release can walk you through it, but don't hesitate to ask for clarification if the documentation isn't explanatoryenough.

coreshock commented 11 months ago

Hello @painebenjamin - no worries and many thanks for being so supportive.

I tried the Conda way but got the following:

(base) F:\enfugue-server>conda env create -f F:\enfugue-server\windows-cuda.yml
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\ProgramData\anaconda3\Lib\multiprocessing\__init__.py", line 16, in <module>
    from . import context
  File "C:\ProgramData\anaconda3\Lib\multiprocessing\context.py", line 6, in <module>
    from . import reduction
  File "C:\ProgramData\anaconda3\Lib\multiprocessing\reduction.py", line 16, in <module>
    import socket
  File "C:\ProgramData\anaconda3\Lib\socket.py", line 51, in <module>
    import _socket
ImportError: Module use of python310.dll conflicts with this version of Python.

Here's the Conda info, probably I should default to Python 3.10?

(base) C:\Users\oresh>conda info

     active environment : base
    active env location : C:\ProgramData\anaconda3
            shell level : 1
       user config file : C:\Users\oresh\.condarc
 populated config files : C:\Users\oresh\.condarc
          conda version : 23.7.4
    conda-build version : 3.26.1
         python version : 3.11.5.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=12.3=0
                          __win=0=0

A also attached dxdiag log, if it helps DxDiag.txt

painebenjamin commented 11 months ago

@TrainerSnow that is very helpful, thank you.

Do you happen to have another global Python installation, by chance? We would be able to tell if you go into your environment variables and find a PYTHONPATH entry pointing somewhere other than your Anaconda installation.

To see environment variables on Windows, open the start menu and begin typing "Environment". You will see an option that says "Edit the system environment variables," click this. In the popup window, click "Environment Variables."

image

TrainerSnow commented 11 months ago

Hi, this is the only env vars that i have: grafik

coreshock commented 11 months ago

@painebenjamin @TrainerSnow Probably that was a question for me? :) Actually I removed PYTHONPATH system env variable.

When I try to locate available python installations, I'm getting multiple paths - probably this is the cause? image

painebenjamin commented 11 months ago

@TrainerSnow 😳 very sorry, that question was indeed intended for @coreshock. Though since you're both experiencing the same problem perhaps you can benefit from performing the same exercise that @coreshock did, and you may find a global installation of a different version of python. That may indeed be the root of all of this.

@coreshock my recommendation to get the anaconda installation working would actually just be to update ENFUGUE's environment file to use 3.11. There's no harm in doing so, I only use 3.10 as default for backwards compatibility's sake.

Go into the windows-cuda.yml file with a text editor, and change the line python=3.10.11 to python=3.11.5. You'll want to make sure that conda doesn't have any dangling installation remnants, so do this to install:

conda remove -n enfugue -y --all
conda clean -y --all
conda env create -f F:\enfugue-server\windows-cuda.yml

Hopefully that gets you moving!

coreshock commented 11 months ago

@painebenjamin I have to confess one stupid mistake: I tried to get windows-cuda.yml by right click + "save link as", which resulted in downloading the html instead of yml under the correct name. So the troubleshooting boils down only to environment installation via Conda via provided instructions. This part now runs okay, but jax still missing.

The best so far I could achieve is jax installation via pip install jax[cuda111] -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver and then pip install -U jax jaxlib

Then I got this:

Name: jaxlib
Version: 0.4.20
Summary: XLA library for JAX
Home-page: https://github.com/google/jax
Author: JAX team
Author-email: jax-dev@google.com
License: Apache-2.0
Location: c:\programdata\anaconda3\envs\enfugue\lib\site-packages
Requires: ml-dtypes, numpy, scipy
Required-by:

(enfugue) F:\enfugue-server>pip show jax
Name: jax
Version: 0.4.20
Summary: Differentiate, compile, and transform Numpy code.
Home-page: https://github.com/google/jax
Author: JAX team
Author-email: jax-dev@google.com
License: Apache-2.0
Location: c:\programdata\anaconda3\envs\enfugue\lib\site-packages
Requires: ml-dtypes, numpy, opt-einsum, scipy
Required-by:

But I'm still getting

AttributeError: partially initialized module 'jax' has no attribute 'version' (most likely due to a circular import)

Could it be that server uses another environment?