Add build support for Nvidia Spark

This commit is contained in:
Jaret Burkett committed 2026-07-28 12:27:51 -06:00
1 parent 6d6c5a3d91
commit aa762103b3
10 files changed
+765 -44

No files matched your search

+17 -3
View File
@@ -48,8 +48,17 @@ _SOURCES = {
("linux", "x86_64"): _BTBN + "ffmpeg-n8.1-latest-linux64-gpl-shared-8.1.tar.xz",
("linux", "aarch64"): _BTBN + "ffmpeg-n8.1-latest-linuxarm64-gpl-shared-8.1.tar.xz",
("windows", "x86_64"): _BTBN + "ffmpeg-n8.1-latest-win64-gpl-shared-8.1.zip",
# Windows-on-ARM in the emulated-x64 stack gets the x64 build, NOT BtbN's
# winarm64 one: an x64 torchcodec can only dlopen x64 FFmpeg DLLs, and the
# exes run fine under emulation.
("windows", "aarch64"): _BTBN + "ffmpeg-n8.1-latest-win64-gpl-shared-8.1.zip",
}
# Native Spark stack: the self-built win_arm64 torchcodec is linked against
# (and dlopens) arm64 FFmpeg 8 — LGPL to keep the distributed torchcodec wheel
# clean, matching C:\Dev spark build scripts / the wheel-set build recipe.
_SPARK_NATIVE_SOURCE = _BTBN + "ffmpeg-n8.1-latest-winarm64-lgpl-shared-8.1.zip"
def bin_dir():
return os.path.join(FFMPEG_DIR, "bin")
@@ -124,15 +133,20 @@ def _install_mac(detection):
shutil.rmtree(tmp, ignore_errors=True)
def source_url(detection):
def source_url(detection, spec=None):
if detection["os"] == "mac":
arch = "arm64" if detection["arch"] == "arm64" else "amd64"
return _RIEDL.format(arch=arch, tool="ffmpeg")
if (
getattr(spec, "backend", None) == "cu134"
and (detection["os"], detection["arch"]) == ("windows", "aarch64")
):
return _SPARK_NATIVE_SOURCE
return _SOURCES.get((detection["os"], detection["arch"]))
def ensure_ffmpeg(detection, dry_run=False):
url = source_url(detection)
def ensure_ffmpeg(detection, dry_run=False, spec=None):
url = source_url(detection, spec=spec)
if url is None:
warn(
"No portable FFmpeg source for %s/%s — skipping local ffmpeg."