Skip to content
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

Whether windwos is supported? #501

Open
Lufffya opened this issue Nov 1, 2022 · 11 comments
Open

Whether windwos is supported? #501

Lufffya opened this issue Nov 1, 2022 · 11 comments

Comments

@Lufffya
Copy link

Lufffya commented Nov 1, 2022

❓ Questions and Help

@danthe3rd
Copy link
Contributor

Hi,
Windows is supported, but you will have to build xFormers yourself as we don't provide windows binaries at the moment

@Lufffya
Copy link
Author

Lufffya commented Nov 3, 2022

Hi, Windows is supported, but you will have to build xFormers yourself as we don't provide windows binaries at the moment

I see.
But cuda can only be 11.3 and 11.6, which makes me confused, can other versions, such as 11.8?

@danthe3rd
Copy link
Contributor

We provide binaries for cuda 11.3 and 11.6 (but only for linux and specific versions of pytorch). If you build from source, we support any version of cuda >= 11.3 (and maybe even earlier versions of CUDA, but not tested).

@BlankFX1
Copy link

BlankFX1 commented Dec 5, 2022

Windows is not really supported.
The information you have to compile it yourself, is of no use, as Anaconda for Windows is not designed to be able to handle the long filenames this repo uses.
It will always run into an error stating "Filename too long" in its default configuration.

And as Anaconda ignores the .condarc-File it generated itself, I also haven't found out a way to move it to another target folder.

@danthe3rd
Copy link
Contributor

The "filename too long" is a limitation in Windows, that can be addressed.

You can also download windows builds from there (have to be installed manually): https://github.com/facebookresearch/xformers/actions/runs/3616539007

@BlankFX1
Copy link

BlankFX1 commented Dec 5, 2022

In addition to Windows' limitation also git has to be configured to use long filenames by using
git config --system core.longpaths true

Sadly none of this will help, as ninja doesn't appear to be working with long filenames either. I'm aware of no fix.

ninja: error: Stat(C:/Users/[...]/xformers/components/attention/csrc/attention.obj): Filename longer than 260 characters.

Uninstalling ninja (and making sure it really is) irritatingly makes no difference, giving the exact same error.

Will try my luck with the windows builds you kindly mentioned.

@bottler
Copy link
Contributor

bottler commented Dec 5, 2022

@BlankFX1 I think another user had luck by moving the build to a directory with a short name. I'm not sure how long your ... is. Can you try working somewhere likec:\t?

@BlankFX1
Copy link

BlankFX1 commented Dec 5, 2022

As mentioned above I tried moving that folder yesterday by telling Anaconda to use a very short path. Sadly Anaconda keeps ignoring the .condarc-File it generated itself and I'm not familiar enough with it to know how I can tell it else what folder to use.

Working with the linked windows builds didn't work either as none of them appears to be compatible

WARNING: Could not find module 'B:\anaconda3\envs\db-diffusers\Lib\site-packages\xformers_C.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

@yocabon
Copy link
Contributor

yocabon commented Dec 7, 2022

Hi,
Long paths can be enabled on Windows 10, version 1607, and later (not just with git), so it shouldn't be an issue (saw that in #543 they get the same error).

Just run in an elevated powershell prompt (I'm not aware of any downside to enabling them, but there may be)

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

reference:
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell

@bangonkali
Copy link

Hi guys, I ran the following:

pip install ninja
git config --system core.longpaths true
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Redacted logs are as follows:

(venv) PS C:\Users\Bangonkali\Desktop\Projects\stable-diffusion-webui> pip install ninja
Requirement already satisfied: ninja in c:\users\bangonkali\desktop\projects\stable-diffusion-webui\venv\lib\site-packages (1.11.1)
(venv) PS C:\Users\Bangonkali\Desktop\Projects\stable-diffusion-webui>
(venv) PS C:\Users\Bangonkali\Desktop\Projects\stable-diffusion-webui> git config --system core.longpaths true
(venv) PS C:\Users\Bangonkali\Desktop\Projects\stable-diffusion-webui> New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force


LongPathsEnabled : 1
PSPath           : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
PSParentPath     : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
PSChildName      : FileSystem
PSDrive          : HKLM
PSProvider       : Microsoft.PowerShell.Core\Registry



(venv) PS C:\Users\Bangonkali\Desktop\Projects\stable-diffusion-webui> pip install -v -U git+https://github.com/facebookresearch/xformers.g
it@main#egg=xformers
Using pip 22.3.1 from C:\Users\Bangonkali\Desktop\Projects\stable-diffusion-webui\venv\lib\site-packages\pip (python 3.10)
Collecting xformers
  Cloning https://github.com/facebookresearch/xformers.git (to revision main) to c:\users\bangonkali\appdata\local\temp\pip-install-83oykyll\xformers_b9a263a0d0cb4eb49808ee420fcb6556
  Running command git version
  git version 2.38.0.windows.1
  Running command git clone --filter=blob:none https://github.com/facebookresearch/xformers.git 'C:\Users\Bangonkali\AppData\Local\Temp\pip-install-83oykyll\xformers_b9a263a0d0cb4eb49808ee420fcb6556'
  Cloning into 'C:\Users\Bangonkali\AppData\Local\Temp\pip-install-83oykyll\xformers_b9a263a0d0cb4eb49808ee420fcb6556'...
  Updating files:   0% (2/632)
....
....
....
  Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  ninja: error: Stat(C:/Users/Bangonkali/AppData/Local/Temp/pip-install-83oykyll/xformers_b9a263a0d0cb4eb49808ee420fcb6556/build/temp.win32-cpython-310/Release/Users/Bangonkali/AppData/Local/Temp/pip-install-83oykyll/xformers_b9a263a0d0cb4eb49808ee420fcb6556/xformers/components/attention/csrc/attention.obj): Filename longer than 260 characters
  Traceback (most recent call last):
    File "C:\Users\Bangonkali\Desktop\Projects\stable-diffusion-webui\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1808, in _run_ninja_build
      subprocess.run(
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

From within that, I got:

83oykyll/xformers_b9a263a0d0cb4eb49808ee420fcb6556/xformers/components/attention/csrc/attention.obj): Filename longer than 260 characters

I'm using elevated Windows PowerShell for VS 2022 with Microsoft Build Tools preinstalled.

image

It seems something else is still enforcing 260 character filename length limit.

Attached full log: ninja-windows-10-long-file-path.txt

@bangonkali
Copy link

It seems it could be related to this ninja-build/ninja#1900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants