triton-inference-server / server

The Triton Inference Server provides an optimized cloud and edge inferencing solution.
https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/index.html
BSD 3-Clause "New" or "Revised" License
8.3k stars 1.48k forks source link

How to run triton on windows10? #4737

Closed LLsmile closed 2 years ago

LLsmile commented 2 years ago

How to run triton without docker on windows10? Is there any guidelines?

tanmayv25 commented 2 years ago

We have instructions to build triton for windows10 here: https://github.com/triton-inference-server/server/blob/main/docs/build.md#building-for-windows-10

Are there any specific issues that you are running into when launching triton on windows 10?

LLsmile commented 2 years ago

I installed git&&docker&&python3&&pip and try to build without docker. After running python build.py --cmake-dir ./cmake_dir --build-dir ./build_dir --no-container-pull --no-container-build --enable-logging --enable-stats --enable-tracing --enable-gpu --endpoint=grpc --endpoint=http --backend=ensemble --backend=tensorrt:main --backend=onnxruntime:main, it shows: `Mode LastWriteTime Length Name


d----- 2022/8/6 11:37 build CMake Error: The source directory "C:/03_workspace/05_repo/server/build_dir/build_dir/tritonserver/build/cmake_dir" does not exist. Specify --help for usage, or press the help button on the CMake GUI. exited with status code 1

error: build failed`

tanmayv25 commented 2 years ago

@nv-kmcgill53 @mc-nv Can you offer some guidance to the user here?

mc-nv commented 2 years ago

--cmake_dir and --build-dir are not mandatory arguments user can try to drop them, as it lookups for the source code directory. --cmake-dir location must contain CMakeList.txt

nv-kmcgill53 commented 2 years ago

As @mc-nv stated above, the --cmake-dir is the source code directroy with the associated CMakeList.txt file. As an aside, we suggest using a release branch rather than main, as the release branches have gone through more testing and we reserve main for development. Our latest release is r22.07.

For any extra dependencies for windows which you may need, consult the windows Dockerfile which specifies the minimum environment requirements to build.

LLsmile commented 2 years ago

--cmake_dir and --build-dir are not mandatory arguments user can try to drop them, as it lookups for the source code directory. --cmake-dir location must contain CMakeList.txt

After dropping --build-dir, it shows error: --no-container-build requires --build-dir. It seems --build-dir cannot be dropped.

LLsmile commented 2 years ago

As @mc-nv stated above, the --cmake-dir is the source code directroy with the associated CMakeList.txt file. As an aside, we suggest using a release branch rather than main, as the release branches have gone through more testing and we reserve main for development. Our latest release is r22.07.

For any extra dependencies for windows which you may need, consult the windows Dockerfile which specifies the minimum environment requirements to build.

After checking to r22.07 and running python build.py --build-dir ./build --no-container-pull --no-container-build --enable-logging --enable-stats --enable-tracing --enable-gpu --endpoint=grpc --endpoint=http --backend=ensemble, errors shows:

Building Triton Inference Server
platform windows
machine amd64
version 2.24.0
build dir ./build
install dir ./build\opt\tritonserver
cmake dir C:\03_workspace\05_repo\server
default repo-tag: r22.07
container version 22.07
upstream container version 22.07
endpoint "grpc"
endpoint "http"
backend "ensemble" at tag/branch "r22.07"
component "common" at tag/branch "r22.07"
component "core" at tag/branch "r22.07"
component "backend" at tag/branch "r22.07"
component "thirdparty" at tag/branch "r22.07"
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

    Directory: C:\03_workspace\05_repo\server\build\build\tritonserver

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         8/12/2022   3:19 PM                build
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19044.
CMake Warning (dev) at C:/02_software/cmake/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  C:/02_software/cmake/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  build/build/tritonserver/build/_deps/repo-third-party-src/CMakeLists.txt:355 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

Using MSVC as compiler, default target on Windows 10. If the target system is not Windows 10, please update _WIN32_WINNT to corresponding value.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/03_workspace/05_repo/server/build/build/tritonserver/build
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

     6>C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microso
       ft.CppCommon.targets(241,5): error MSB8066: Custom build for 'C:\03_workspace\05_repo\server\bui
       ld\build\tritonserver\build\CMakeFiles\6dbbc41732f64bd7bcd2de4f9920885b\cnmem-patch.rule;C:\03_w
       orkspace\05_repo\server\build\build\tritonserver\build\CMakeFiles\6dbbc41732f64bd7bcd2de4f992088
       5b\cnmem-configure.rule;C:\03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFiles
       \6dbbc41732f64bd7bcd2de4f9920885b\cnmem-build.rule;C:\03_workspace\05_repo\server\build\build\tr
       itonserver\build\CMakeFiles\6dbbc41732f64bd7bcd2de4f9920885b\cnmem-install.rule;C:\03_workspace\
       05_repo\server\build\build\tritonserver\build\CMakeFiles\03700ca26af3e3d7257bfd27d91f470c\cnmem-
       complete.rule;C:\03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFiles\1bd3d4cd5
       d87e8cdd2b56a3fac7e42d5\cnmem.rule' exited with code 9009. [C:\03_workspace\05_repo\server\build
       \build\tritonserver\build\_deps\repo-third-party-build\cnmem.vcxproj]
    11>C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microso
       ft.CppCommon.targets(241,5): error MSB8066: Custom build for 'C:\03_workspace\05_repo\server\bui
       ld\build\tritonserver\build\CMakeFiles\af20a03530242be1cb53ff33cf0fe57d\grpc-repo-update.rule;C:
       \03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFiles\af20a03530242be1cb53ff33c
       f0fe57d\grpc-repo-patch.rule;C:\03_workspace\05_repo\server\build\build\tritonserver\build\CMake
       Files\af20a03530242be1cb53ff33cf0fe57d\grpc-repo-configure.rule;C:\03_workspace\05_repo\server\b
       uild\build\tritonserver\build\CMakeFiles\af20a03530242be1cb53ff33cf0fe57d\grpc-repo-build.rule;C
       :\03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFiles\af20a03530242be1cb53ff33
       cf0fe57d\grpc-repo-install.rule;C:\03_workspace\05_repo\server\build\build\tritonserver\build\CM
       akeFiles\af20a03530242be1cb53ff33cf0fe57d\grpc-repo-test.rule;C:\03_workspace\05_repo\server\bui
       ld\build\tritonserver\build\CMakeFiles\03700ca26af3e3d7257bfd27d91f470c\grpc-repo-complete.rule;
       C:\03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFiles\1bd3d4cd5d87e8cdd2b56a3
       fac7e42d5\grpc-repo.rule' exited with code 9009. [C:\03_workspace\05_repo\server\build\build\tri
       tonserver\build\_deps\repo-third-party-build\grpc-repo.vcxproj]
    12>C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microso
       ft.CppCommon.targets(241,5): error MSB8066: Custom build for 'C:\03_workspace\05_repo\server\bui
       ld\build\tritonserver\build\CMakeFiles\b3645fb828a880d054d696ef37234e18\libevent-update.rule;C:\
       03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFiles\b3645fb828a880d054d696ef37
       234e18\libevent-patch.rule;C:\03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFi
       les\b3645fb828a880d054d696ef37234e18\libevent-configure.rule;C:\03_workspace\05_repo\server\buil
       d\build\tritonserver\build\CMakeFiles\b3645fb828a880d054d696ef37234e18\libevent-build.rule;C:\03
       _workspace\05_repo\server\build\build\tritonserver\build\CMakeFiles\b3645fb828a880d054d696ef3723
       4e18\libevent-install.rule;C:\03_workspace\05_repo\server\build\build\tritonserver\build\CMakeFi
       les\03700ca26af3e3d7257bfd27d91f470c\libevent-complete.rule;C:\03_workspace\05_repo\server\build
       \build\tritonserver\build\CMakeFiles\1bd3d4cd5d87e8cdd2b56a3fac7e42d5\libevent.rule' exited with
        code 9009. [C:\03_workspace\05_repo\server\build\build\tritonserver\build\_deps\repo-third-part
       y-build\libevent.vcxproj]
exited with status code 1
error: build failed
LLsmile commented 2 years ago

@nv-kmcgill53 I have finished most of the dependencies in win10 dockerfile, such as pip install --upgrade wheel setuptools docker && pip install grpcio-tools && vcpkg.exe install openssl:x64-windows openssl-windows:x64-windows rapidjson:x64-windows re2:x64-windows boost-interprocess:x64-windows boost-stacktrace:x64-windows zlib:x64-windows pthread:x64-windows b64:x64-windows && vcpkg.exe integrate install. But cuda/cudnn/tensorRT versions are not exactly same in my computer, which is cuda11.6, cudnn8.4 and tensorRT-8.4.1.5.

nv-kmcgill53 commented 2 years ago

Hi @LLsmile, can you explain a little more about the versioning issue you are running into? I see you are attempting to build on your host machine by using the --no-container-build flag in your build.py command. In general, we suggest using docker to build the artifacts as it's easier to control the windows environment in this process. i.e. You edit the Dockerfile.win10.min file to update the versions you wish to use, build the min contianer, and finally invoke build.py to use this min container to build the executable and any backends/repo-agents/etc.

All that said, if you are unable to use docker on windows for any reason, then you must setup and control the environment yourself. I was able to compile tritonserver without any backends on my host machine with the following steps:

  1. Checkout the branch of server you want to use. (I used main but it is easy enough to use one of the release branches)
  2. $mkdir C:\tmp\tritonbuild
  3. $cd C:\<path>\<to>\server
  4. $cmake "-DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/<path>/<to>/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX:PATH="C:\<path>\<to>\<install>" -DTRITON_COMMON_REPO_TAG:STRING=main -DTRITON_CORE_REPO_TAG:STRING=main -DTRITON_BACKEND_REPO_TAG:STRING=main -DTRITON_THIRD_PARTY_REPO_TAG:STRING=main -DTRITON_ENABLE_LOGGING:BOOL=ON" "-DTRITON_ENABLE_STATS:BOOL=ON" "-DTRITON_ENABLE_METRICS:BOOL=OFF" "-DTRITON_ENABLE_METRICS_GPU:BOOL=OFF" "-DTRITON_ENABLE_TRACING:BOOL=ON" "-DTRITON_ENABLE_NVTX:BOOL=OFF" "-DTRITON_ENABLE_GPU:BOOL=ON" "-DTRITON_MIN_COMPUTE_CAPABILITY=6.0" "-DTRITON_ENABLE_MALI_GPU:BOOL=OFF" "-DTRITON_ENABLE_GRPC:BOOL=ON" "-DTRITON_ENABLE_HTTP:BOOL=ON" "-DTRITON_ENABLE_SAGEMAKER:BOOL=OFF" "-DTRITON_ENABLE_VERTEX_AI:BOOL=OFF" "-DTRITON_ENABLE_GCS:BOOL=OFF" "-DTRITON_ENABLE_S3:BOOL=OFF" "-DTRITON_ENABLE_AZURE_STORAGE:BOOL=OFF" "-DTRITON_ENABLE_ENSEMBLE:BOOL=ON" "-DTRITON_ENABLE_TENSORRT:BOOL=ON" -B C:\tmp\tritonbuild -S C:\<path>\<to>\server\
  5. $cd C:\tmp\tritonbuild
  6. I didn't investigate this next part too closely but I invoked $cmake --build ./ to build the third-party repositories before moving onto the next step. During this process you may have to define some environment variables which are not set.
  7. $msbuild.exe -m:40 -p:Configuration=Release install.vcxproj

At this point you should have built tritonserver.exe and it will be placed in the CMAKE_INSTALL_PREFIX directory. You can test this executable by invoking $tritonserver.exe --model-repository=C:\<dummy>\<path>\<to>\models --exit-on-error=false and seeing that it starts up and runs without errors.

Note: This process didn't build any other repositories other than server, core, common, and third-party. You can continue building the backends you desire by following the same process as above just starting in the respective repository. i.e. For building the tensorrt_backend check out the repository and follow the similar cmake/msbuild steps as above.

tanmayv25 commented 2 years ago

Closing this issue because of the lack of activity. Please open a new issue if the error persists.

lucasjinreal commented 1 year ago

Why not support pip install for windows?

ahmedbr commented 1 year ago

Why not support pip install for windows?

Any updates on this? It seems that the problem continues

saphtea commented 1 year ago

I'll be honest, I'm finding triton requirements popping up on a lot of cutting edge projects, it would be fantastic to get windows build wheels for this.

nv-kmcgill53 commented 1 year ago

CC: @Christina-Young-NVIDIA @dzier

bhishanpdl commented 8 months ago

I also tried to install triton on Windows 10 and hit with the error.

If anyone has successfully installed trion on windows please post the procedure.

Code

# i create brand new venv with python3.11 and just tried to install only one module 'triton'
git clone https://github.com/openai/triton.git;
cd triton/python;
pip install cmake; # build-time dependency
pip install -e .

Error

 pip --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org install -e .
Obtaining file:///C:/Users/myUser/venv/py311aqlm/triton/python
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      Traceback (most recent call last):
        File "C:\Users\axx\venv\py311aqlm\Lib\site-packages\pip\_vendor\pyp
roject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\a12xx\venv\py311aqlm\Lib\site-packages\pip\_vendor\pyp
roject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\a12xx\venv\py311aqlm\Lib\site-packages\pip\_vendor\pyp
roject_hooks\_in_process\_in_process.py", line 132, in get_requires_for_build_e
ditable
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\a126xx\AppData\Local\Temp\pip-build-env-lsskzlf6\overla
y\Lib\site-packages\setuptools\build_meta.py", line 448, in get_requires_for_bu
ild_editable
          return self.get_requires_for_build_wheel(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\a12xx\AppData\Local\Temp\pip-build-env-lsskzlf6\overla
y\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_bu
ild_wheel
          return self._get_build_requires(config_settings, requirements=['wheel
'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^
        File "C:\Users\a126xx\AppData\Local\Temp\pip-build-env-lsskzlf6\overla
y\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\a126\AppData\Local\Temp\pip-build-env-lsskzlf6\overla
y\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\a126\AppData\Local\Temp\pip-build-env-lsskzlf6\overla
y\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 372, in <module>
        File "<string>", line 213, in download_and_copy
      KeyError: 'AMD64'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem wi
th pip.
error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with
 pip.
Pauweltje commented 8 months ago

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [8 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\CubasePC\AppData\Local\Temp\pip-install-rutdivtz\sh_b5b891f5b99341ec97e730d5f642ab09\setup.py", line 5, in import sh File "C:\Users\CubasePC\AppData\Local\Temp\pip-install-rutdivtz\sh_b5b891f5b99341ec97e730d5f642ab09\sh.py", line 37, in import fcntl ModuleNotFoundError: No module named 'fcntl' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

Pauweltje commented 8 months ago

This is getting pretty annoying!

DarkAlchy commented 7 months ago

Triton only for Linux is beyond annoying and frankly I find the devs who are refusing to support a pip install build for Windows to be beyond reprehensible at this point. triton-2.0.0-cp310-cp310-win_amd64.whl someone was able to build that, and it did work until recently, but that is a really old version. I gave up trying to build it.

nikocraft commented 7 months ago

PS E:\software\triton\python> pip install . Processing e:\software\triton\python Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [18 lines of output] Traceback (most recent call last): File "C:\Users\maxnb\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "C:\Users\maxnb\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\maxnb\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\maxnb\AppData\Local\Temp\pip-build-env-xir7tkl4\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "C:\Users\maxnb\AppData\Local\Temp\pip-build-env-xir7tkl4\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\maxnb\AppData\Local\Temp\pip-build-env-xir7tkl4\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\maxnb\AppData\Local\Temp\pip-build-env-xir7tkl4\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 372, in File "", line 213, in download_and_copy KeyError: 'AMD64' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.