Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ add_compile_definitions(NEMO_SPEECH_VERSION_STR="${NEMO_SPEECH_VERSION}")

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
if(WIN32)
# Install the Visual C++ runtime required by Windows packages.
include(InstallRequiredSystemLibraries)
endif()
set(NEMO_SPEECH_LICENSE_INSTALL_DIR
"${CMAKE_INSTALL_DATADIR}/licenses/nemo-speech")
install(FILES LICENSE NOTICE THIRD_PARTY_NOTICES.md
Expand Down Expand Up @@ -116,6 +120,27 @@ endif()
if(NEMO_SPEECH_BUILD_GRPC)
set(NEMO_SPEECH_WITH_GRPC ON)
endif()

# Reject invalid component combinations early.
if(WIN32 AND NEMO_SPEECH_WITH_NORM)
message(FATAL_ERROR
"NEMO_SPEECH_WITH_NORM is not supported on Windows; disable normalization")
endif()
if(NEMO_SPEECH_BUILD_GRPC AND
(NOT NEMO_SPEECH_BUILD_ASR OR NOT NEMO_SPEECH_BUILD_TTS))
message(FATAL_ERROR
"NEMO_SPEECH_BUILD_GRPC currently requires both ASR and TTS")
endif()
if(NEMO_SPEECH_WITH_FLASHLIGHT AND NOT NEMO_SPEECH_BUILD_ASR)
message(FATAL_ERROR "NEMO_SPEECH_WITH_FLASHLIGHT requires ASR")
endif()
if((NEMO_SPEECH_TTS_WITH_JA OR NEMO_SPEECH_TTS_WITH_ZH) AND
NOT NEMO_SPEECH_BUILD_TTS)
message(FATAL_ERROR "Optional TTS tokenizers require NEMO_SPEECH_BUILD_TTS=ON")
endif()
if(NEMO_SPEECH_HTTP_TLS AND NOT NEMO_SPEECH_BUILD_HTTP)
message(FATAL_ERROR "NEMO_SPEECH_HTTP_TLS requires NEMO_SPEECH_BUILD_HTTP=ON")
endif()
if(NEMO_SPEECH_BUILD_TESTS)
set(BUILD_TESTING ON CACHE BOOL "Build first-party test executables" FORCE)
elseif(BUILD_TESTING)
Expand Down Expand Up @@ -410,6 +435,17 @@ endif()

set(NEMO_SPEECH_THIRD_PARTY_LICENSE_DIR
"${NEMO_SPEECH_LICENSE_INSTALL_DIR}/third_party")
if(DEFINED VCPKG_INSTALLED_DIR AND DEFINED VCPKG_TARGET_TRIPLET)
file(GLOB _NEMO_SPEECH_VCPKG_COPYRIGHTS LIST_DIRECTORIES false
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/*/copyright")
foreach(_copyright IN LISTS _NEMO_SPEECH_VCPKG_COPYRIGHTS)
get_filename_component(_share_dir "${_copyright}" DIRECTORY)
get_filename_component(_package "${_share_dir}" NAME)
install(FILES "${_copyright}"
DESTINATION "${NEMO_SPEECH_THIRD_PARTY_LICENSE_DIR}/vcpkg/${_package}"
RENAME LICENSE)
endforeach()
endif()
install(FILES ggml/LICENSE
DESTINATION "${NEMO_SPEECH_THIRD_PARTY_LICENSE_DIR}/ggml")
if(TARGET nemo_speech_cublas_shim)
Expand Down
21 changes: 16 additions & 5 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ are explicitly excluded and are not compiled or linked.
- Copyright The OpenSSL Project Authors and other contributors
- License: Apache License 2.0

OpenSSL is dynamically linked only when optional HTTP-server TLS is enabled. It
is not incorporated into the source tree. The default container disables HTTP
TLS, links gRPC's unsecure libraries, and does not distribute OpenSSL.
Distributions that enable HTTP TLS must include the applicable OpenSSL
attribution and Apache 2.0 terms.
OpenSSL is linked only when HTTP-server TLS is enabled. Windows packages include
its license. The default Linux container does not include OpenSSL.

### Windows vcpkg dependencies

Windows builds obtain optional dependencies through vcpkg. Installed packages
include each selected dependency's license.

### Container system libraries

Expand All @@ -129,6 +131,15 @@ project notice set is installed under

## Other incorporated third-party code and data

### SentencePiece

- Source: [`google/sentencepiece`](https://github.com/google/sentencepiece)
- Copyright 2018 Google Inc.
- License: Apache License 2.0

Default Windows ASR builds link SentencePiece statically and include its license
notice.

### whisper.cpp sample audio

The ASR quick-start fixture at `test_files/asr/wav/test/jfk.wav` is copied from
Expand Down
59 changes: 23 additions & 36 deletions docs/development/windows-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ compiler on Windows).
- Warning flags are scoped to C/C++ compilation
(`$<COMPILE_LANGUAGE:C,CXX>`) so nvcc's `cl` host never receives them - with
clang-cl as CXX they would otherwise leak into the CUDA compile (`D8021`).
- **clang-cl + gRPC:** linking clang-cl-compiled code against MSVC-built
*shared* protobuf (vcpkg `x64-windows`) can fail on `dllimport` symbols the
MSVC DLL doesn't export. For `-Grpc` builds with clang-cl, install the vcpkg
deps under the `x64-windows-static-md` triplet (static protobuf/gRPC) and
configure with that triplet.
- **ARM64 specifics.** CUDA 13.4+/CCCL 3.4 requires the `cuda/iterator` include
fix present in the current ggml pin. On integrated GPUs (e.g. Tegra), Vulkan
devices enumerate as iGPU (`GGML_BACKEND_DEVICE_TYPE_IGPU`), which the ASR
Expand All @@ -56,16 +51,9 @@ ARM64 builds also require the Visual Studio
`Microsoft.VisualStudio.Component.VC.Tools.ARM64` and
`Microsoft.VisualStudio.Component.VC.Llvm.Clang` individual components.

For the **gRPC server** or **Flashlight decoder** you also need vcpkg. The
commands below show gRPC's shared x64 dependencies; Flashlight's architecture-
specific command is in [Optional features](#optional-features-flashlight-itn).

```powershell
git clone --depth 1 https://github.com/microsoft/vcpkg C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat -disableMetrics
# grpc pulls protobuf and abseil.
C:\vcpkg\vcpkg.exe install grpc protobuf --triplet x64-windows
```
The build driver downloads required vcpkg dependencies under
`%LOCALAPPDATA%\NeMoSpeech`. Use `-VcpkgRoot` or `-VcpkgTriplet` to override the
defaults.

> **PATH note:** installers update the *machine* `PATH`, which an already-open
> shell won't see. Open a new terminal afterward (or let `build.ps1` refresh the
Expand Down Expand Up @@ -110,20 +98,28 @@ powershell -ExecutionPolicy Bypass -File scripts\windows\build.ps1 -Backend vulk
powershell -ExecutionPolicy Bypass -File scripts\windows\build.ps1 -Backend cpu

# CPU ASR + TTS + HTTP API, realtime WebSocket, and playground
powershell -ExecutionPolicy Bypass -File scripts\windows\build.ps1 -Backend cpu -Http
powershell -ExecutionPolicy Bypass -File scripts\windows\build.ps1 -Backend cpu -Profile server

# Full runtime profile (add -HttpTls for TLS)
powershell -ExecutionPolicy Bypass -File scripts\windows\build.ps1 -Backend cpu -Profile full

# Full profile plus tests, examples, and diagnostic tools
powershell -ExecutionPolicy Bypass -File scripts\windows\build.ps1 -Backend cpu -Profile developer

# CPU + Flashlight decoder + dynamically linked KenLM
powershell -ExecutionPolicy Bypass -File scripts\windows\build.ps1 -Backend cpu -Flashlight

```

Key parameters: `-Backend cuda|vulkan|cpu`, `-Architecture auto|x64|arm64`,
`-Grpc`, `-Nmt`, `-AsrOnly`, `-Http`, `-Flashlight`,
Key parameters: `-Backend cuda|vulkan|cpu`,
`-Profile core|asr|server|full|developer`,
`-Architecture auto|x64|arm64`,
`-Grpc`, `-Nmt`, `-AsrOnly`, `-Http`, `-HttpTls`, `-Flashlight`, `-TtsJa`,
`-TtsZh`,
`-Config Release|RelWithDebInfo|Debug`, `-CudaArch <native|89|86|120|…>`,
`-VcpkgRoot C:\vcpkg`, `-VcpkgTriplet <triplet>`, `-BuildDir <path>`, `-Jobs N`.
Binaries land in `build-<backend>\bin`; an explicit `-Architecture` uses
`build-<backend>-<architecture>\bin` by default so x64 and ARM64 caches cannot
collide.
Binaries land in `build-<backend>[-<profile>][-<architecture>]\bin`; the default
`core` and `auto` suffixes are omitted.

## Build with raw CMake

Expand Down Expand Up @@ -220,17 +216,11 @@ user-set value of the env var takes precedence over the auto-set.

| Feature (CMake flag) | Windows status |
|---|---|
| **Flashlight** (`-DNEMO_SPEECH_WITH_FLASHLIGHT=ON`) | ✅ Builds replaceable `kenlm.dll`. Install `sentencepiece` with vcpkg's `x64-windows-static-md` triplet on x64 or `arm64-windows-static-md` on ARM64, then use `build.ps1 -Flashlight`. |
| **Flashlight** (`-DNEMO_SPEECH_WITH_FLASHLIGHT=ON`) | ✅ Builds replaceable `kenlm.dll`; SentencePiece and compression libraries are provisioned automatically. |
| **ITN/TN** (`-DNEMO_SPEECH_WITH_NORM=ON`) | ❌ Not supported on Windows. Requires the OpenFST 1.8 / Sparrowhawk WFST stack, which `scripts/build_itn_deps.sh` builds via Linux autotools (neither is in vcpkg). |

**Combining flashlight + gRPC on Windows:** the instructions above use different
vcpkg linkage (gRPC with the *shared* triplet, flashlight with *static-md*). For
one build with both, install **all** vcpkg deps (grpc + sentencepiece)
under a single static-md triplet matching the host architecture -
`x64-windows-static-md` on x64, `arm64-windows-static-md` on ARM64 (likewise
`x64-windows` / `arm64-windows` are the shared analogs elsewhere in this guide,
which shows x64 commands) - and configure with that triplet, so there's one
consistent protobuf/abseil.
Automatic dependencies use one architecture-matched `*-windows-static-md`
triplet.

## Next steps

Expand All @@ -241,9 +231,6 @@ Model conversion and runtime commands are platform-neutral. Continue with:
- [Server configuration](../server.md)
- [Client integration](../clients.md)

> **Run-time PATH:** run from a shell that has the CUDA Toolkit `bin` and the MSVC
> runtime on `PATH` (an *x64 Native Tools* prompt, or after `vcvars64.bat`).
> `ggml-cuda.dll` loads `cudart`/`cublas` from the toolkit and the binaries link the
> VC++ runtime; without them Windows reports `STATUS_DLL_NOT_FOUND` (0xC0000135). The
> component DLLs themselves are already placed next to the `.exe` in
> `build-<backend>\bin`.
> **Run-time PATH:** CUDA build-tree binaries need the CUDA Toolkit `bin` on
> `PATH`. Installed packages place the project DLLs and Visual C++ runtime next
> to the executable.
29 changes: 29 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,41 @@ Select a backend explicitly when needed:
.\scripts\install.ps1 -Source -Backend cuda
```

Select the components to install:

```powershell
# ASR and diarization only
.\scripts\install.ps1 -Source -Backend cpu -Profile asr

# Full runtime profile (add -HttpTls for TLS)
.\scripts\install.ps1 -Source -Backend cuda -Profile full
```

| Profile | Components |
|---|---|
| `core` | ASR, diarization, and TTS |
| `asr` | ASR and diarization |
| `server` (default) | `core` plus the HTTP API and playground |
| `full` | `server` plus NMT, gRPC, Flashlight, and JA/ZH tokenizers |

Use `-Grpc`, `-Nmt`, `-Flashlight`, `-TtsJa`, `-TtsZh`, `-Http`, or `-HttpTls`
to customize a profile. Binary installation is limited to `server`; other
selections build from source. Contributors can run
`.\scripts\windows\build.ps1 -Backend cpu -Profile developer` to build `full`
plus tests, examples, and diagnostic tools.

The default prefix is `%LOCALAPPDATA%\Programs\NeMoSpeech`, and the installer
updates only the current user's PATH. A Windows source build requires Git,
CMake, Ninja, Visual Studio 2022 Build Tools, and the selected backend toolkit.
It includes the same CLI, HTTP API, and playground as the Linux and macOS source
installation.

The source installer downloads required C++ libraries automatically. Use
`-VcpkgRoot` to override its vcpkg location.

CUDA requires the NVIDIA CUDA Toolkit and driver. Vulkan requires the LunarG
Vulkan SDK and a vendor driver. Text normalization is not supported on Windows.

A later installer run checks for the published binary archive first and
replaces an existing source build automatically once the matching archive is
available.
Expand Down
Loading