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

Compilation problems on windows 11 #1560

Open
Jw9394 opened this issue Apr 21, 2023 · 14 comments
Open

Compilation problems on windows 11 #1560

Jw9394 opened this issue Apr 21, 2023 · 14 comments

Comments

@Jw9394
Copy link

Jw9394 commented Apr 21, 2023

hello! i am using a x86 machine and running windows 11 try to compile and install triton on it. so i follow the official instruction

git clone https://github.com/openai/triton.git;
cd triton/python;
pip install cmake; # build-time dependency
pip install -e .

but i got an error

  Building editable for triton (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building editable for triton (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [133 lines of output]

the full log is

PS C:\Users\admin\Desktop\triton\python> pip install -e .
Obtaining file:///C:/Users/admin/Desktop/triton/python
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: filelock in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (from triton==2.1.0) (3.12.0)
Building wheels for collected packages: triton
  Building editable for triton (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building editable for triton (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [133 lines of output]
      running editable_wheel
      creating C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info
      writing C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\PKG-INFO
      writing dependency_links to C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\dependency_links.txt
      writing requirements to C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\requires.txt
      writing top-level names to C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\top_level.txt
      writing manifest file 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\SOURCES.txt'
      reading manifest file 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: manifest_maker: MANIFEST.in, line 3: path 'triton/runtime/backends/' cannot end with '/'

      writing manifest file 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton.egg-info\SOURCES.txt'
      creating 'C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton-2.1.0.dist-info'
      C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\wheel\bdist_wheel.py:100: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
        if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")):
      creating C:\Users\admin\AppData\Local\Temp\pip-wheel-ycx1h9gz\.tmp-_pb7yrz3\triton-2.1.0.dist-info\WHEEL
      running build_py
      running build_ext
      Traceback (most recent call last):
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 155, in run
          self._create_wheel_file(bdist_wheel)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 344, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 267, in _run_build_commands
          self._run_build_subcommands()
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 294, in _run_build_subcommands
          self.run_command(name)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\dist.py", line 1243, in run_command
          super().run_command(command)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 162, in run
        File "<string>", line 180, in build_extension
        File "<string>", line 93, in get_thirdparty_packages
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
          return opener.open(url, data, timeout)
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 503, in open
          req = Request(fullurl, data)
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 322, in __init__
          self.full_url = url
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 348, in full_url
          self._parse()
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 377, in _parse
          raise ValueError("unknown url type: %r" % self.full_url)
      ValueError: unknown url type: ''
      C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py:988: _DebuggingTips: Problem in editable installation.
      !!

              ********************************************************************************
              An error happened while installing `triton` in editable mode.

              The following steps are recommended to help debug this problem:

              - Try to install the project normally, without using the editable mode.
                Does the error still persist?
                (If it does, try fixing the problem before attempting the editable mode).
              - If you are using binary extensions, make sure you have all OS-level
                dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
              - Try the latest version of setuptools (maybe the error was already fixed).
              - If you (or your project dependencies) are using any setuptools extension
                or customization, make sure they support the editable mode.

              After following the steps above, if the problem still persists and
              you think this is related to how setuptools handles editable installations,
              please submit a reproducible example
              (see https://stackoverflow.com/help/minimal-reproducible-example) to:

                  https://github.com/pypa/setuptools/issues

              See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
              ********************************************************************************

      !!
        cmd_obj.run()
      downloading and extracting  ...
      Traceback (most recent call last):
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 273, in build_editable
          return hook(wheel_directory, config_settings, metadata_directory)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 445, in build_editable
          return self._build_with_temp_dir(
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super(_BuildMetaLegacyBackend,
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 231, in <module>
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\dist.py", line 1243, in run_command
          super().run_command(command)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 155, in run
          self._create_wheel_file(bdist_wheel)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 344, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 267, in _run_build_commands
          self._run_build_subcommands()
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 294, in _run_build_subcommands
          self.run_command(name)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\dist.py", line 1243, in run_command
          super().run_command(command)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-l7ll3ltg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 162, in run
        File "<string>", line 180, in build_extension
        File "<string>", line 93, in get_thirdparty_packages
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
          return opener.open(url, data, timeout)
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 503, in open
          req = Request(fullurl, data)
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 322, in __init__
          self.full_url = url
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 348, in full_url
          self._parse()
        File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 377, in _parse
          raise ValueError("unknown url type: %r" % self.full_url)
      ValueError: unknown url type: ''
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for triton
Failed to build triton
ERROR: Could not build wheels for triton, which is required to install pyproject.toml-based projects

is any way to install triton on windows 11? thank you!

@littlestone0806
Copy link

I also have the same problem

@liuyunrui123
Copy link

I also have the same problem on win10

@thiagojramos
Copy link

I'm also having the same issue on Win11 x64.
Triton-install-Log.txt

@lakeback
Copy link

I also have the same problem

@askmyteapot
Copy link

https://github.com/openai/triton#compatibility
Only supports Linux. (Or WSL2, but not guaranteed)

@cooperdk
Copy link

cooperdk commented May 2, 2023

https://github.com/openai/triton#compatibility Only supports Linux. (Or WSL2, but not guaranteed)

But someone did make it work:

pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl

@littlestone0806
Copy link

https://github.com/openai/triton#compatibility Only supports Linux. (Or WSL2, but not guaranteed)

But someone did make it work:

pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl

Thank you very much. I tried it and it only encapsulated a Whl file without modifying the Linux path inside. The error still exists

@MazenVR
Copy link

MazenVR commented Jun 20, 2023

https://github.com/openai/triton#compatibility Only supports Linux. (Or WSL2, but not guaranteed)

But someone did make it work:

pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl

Thanks, you save my time, Triton is now installed in Windows 11

@lhkjacky
Copy link

But someone did make it work:

pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl

I get this error

ERROR: triton-2.0.0-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.

@TimLeeGee
Copy link

TimLeeGee commented Oct 19, 2023

https://github.com/openai/triton#compatibility僅支援Linux。 (或WSL2,但不保證)

但確實有人讓它成功了:
pip安裝https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl

謝謝,你節省了我的時間,Triton現在安裝在Windows 11中

I don't know how to modify it

def default_cache_dir():
return os.path.join(os.environ["HOMEPATH"], ".triton", "cache")

def libcuda_dirs():
locs = subprocess.check_output(["whereis", "libcuda.so"]).decode().strip().split()[1:]
return [os.path.dirname(loc) for loc in locs]

File "C:\Users\b1303\AppData\Roaming\Python\Python310\site-packages\triton\compiler.py", line 1155, in _build
cuda_lib_dirs = libcuda_dirs()
File "C:\Users\b1303\AppData\Roaming\Python\Python310\site-packages\triton\compiler.py", line 1134, in libcuda_dirs
locs = subprocess.check_output(["whereis", "libcuda.so"]).decode().strip().split()[1:]
File "G:\ProgramData\anaconda3\lib\subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "G:\ProgramData\anaconda3\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:
File "G:\ProgramData\anaconda3\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "G:\ProgramData\anaconda3\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2]

@FurkanGozukara
Copy link

Please add Windows support already

@wkpark
Copy link
Contributor

wkpark commented Dec 2, 2023

see also #2738

@DanielNetSet
Copy link

any1 got a fix? even install from source wont work

@Cartooninspector
Copy link

Cartooninspector commented Jan 2, 2024

Start dos prompt
wsl.exe --set-default [ubuntu distribution]
reboot windows
try again

ZzEeKkAa pushed a commit to ZzEeKkAa/triton that referenced this issue Aug 5, 2024
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