From 7b67b51a49b9152b29bf3844e9f781f23d18506f Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 10:00:25 +0000 Subject: [PATCH 01/10] add support for webgpu --- Dockerfile.v132 | 4 ++++ index.js | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/Dockerfile.v132 b/Dockerfile.v132 index fe056b3..37459af 100644 --- a/Dockerfile.v132 +++ b/Dockerfile.v132 @@ -16,6 +16,10 @@ RUN wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-sta apt-mark hold google-chrome-stable && \ rm google-chrome.deb +RUN apt-get install -y \ + libvulkan1 \ + vulkan-tools + # set node source RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh RUN bash nodesource_setup.sh diff --git a/index.js b/index.js index 58d1aa5..d6d7d33 100644 --- a/index.js +++ b/index.js @@ -590,6 +590,9 @@ const main = async () => { "--use-gl=angle", `--use-angle=${angleMode}`, "--use-cmd-decoder=passthrough", + // enable webgpu + "--enable-unsafe-webgpu", + "--enable-features=Vulkan", ], executablePath: process.env.PUPPETEER_EXECUTABLE_PATH, }); @@ -663,6 +666,13 @@ const main = async () => { throw ERRORS.CANVAS_CAPTURE_FAILED; } + // TEMP - check if WebGPU is available + const hasWebGPU = await page.evaluate(() => { + return "gpu" in navigator; + }); + console.log("WebGPU available:", hasWebGPU); + // ------------------------------------------------------------ + // EXTRACT FEATURES console.log("extracting features..."); // find $fxhashFeatures in the window object From 194ddd8fddf1051230b2b7223ecd6045e9cb3e32 Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 10:25:26 +0000 Subject: [PATCH 02/10] webgpu debugging --- index.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d6d7d33..64de8a8 100644 --- a/index.js +++ b/index.js @@ -593,6 +593,8 @@ const main = async () => { // enable webgpu "--enable-unsafe-webgpu", "--enable-features=Vulkan", + "--use-webgpu-adapter=vulkan", + "--enable-dawn-features=allow_unsafe_apis", ], executablePath: process.env.PUPPETEER_EXECUTABLE_PATH, }); @@ -667,10 +669,25 @@ const main = async () => { } // TEMP - check if WebGPU is available - const hasWebGPU = await page.evaluate(() => { - return "gpu" in navigator; + const adapterInfo = await page.evaluate(async () => { + if (!navigator.gpu) return { error: "No GPU API" }; + + const adapter = await navigator.gpu.requestAdapter(); + if (!adapter) return { error: "No adapter returned" }; + + const info = await adapter.requestAdapterInfo(); + const limits = adapter.limits; + + return { + vendor: info.vendor, + architecture: info.architecture, + device: info.device, + description: info.description, + maxTextureDimension2D: limits.maxTextureDimension2D, + }; }); - console.log("WebGPU available:", hasWebGPU); + + console.log("WebGPU Adapter Info:", JSON.stringify(adapterInfo, null, 2)); // ------------------------------------------------------------ // EXTRACT FEATURES From 630f1b3eebb2d95bd66287f99e521009d94c1e68 Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 10:33:49 +0000 Subject: [PATCH 03/10] add nvidia vulkan driver --- Dockerfile.v132 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.v132 b/Dockerfile.v132 index 37459af..88b218f 100644 --- a/Dockerfile.v132 +++ b/Dockerfile.v132 @@ -18,7 +18,8 @@ RUN wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-sta RUN apt-get install -y \ libvulkan1 \ - vulkan-tools + vulkan-tools \ + nvidia-vulkan-icd # set node source RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh From a5e9ceb7d9799f44b78b005c24ed143668f5528c Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 10:39:13 +0000 Subject: [PATCH 04/10] vulkan icd config --- Dockerfile.v132 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile.v132 b/Dockerfile.v132 index 88b218f..fd45c75 100644 --- a/Dockerfile.v132 +++ b/Dockerfile.v132 @@ -16,10 +16,15 @@ RUN wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-sta apt-mark hold google-chrome-stable && \ rm google-chrome.deb +# add vulkan support RUN apt-get install -y \ libvulkan1 \ - vulkan-tools \ - nvidia-vulkan-icd + vulkan-tools + +# create Vulkan ICD config to use NVIDIA driver from host +RUN mkdir -p /etc/vulkan/icd.d && \ + echo '{ "file_format_version": "1.0.0", "ICD": { "library_path": "libGLX_nvidia.so.0", "api_version": "1.3.0" } }' \ + > /etc/vulkan/icd.d/nvidia_icd.json # set node source RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh @@ -45,6 +50,9 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_DRIVER_CAPABILITIES all +# vulkan env vars +ENV VK_ICD_FILENAMES=/etc/vulkan/icd.d/nvidia_icd.json + # setup modules & project WORKDIR /app RUN rm -rf * From 7ad5b335166e2a84cfc9bb4e1e6a4b1a9c8ab812 Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 11:07:13 +0000 Subject: [PATCH 05/10] more webgpu debugging --- index.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/index.js b/index.js index 64de8a8..f93d238 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,8 @@ const PNG = require("pngjs").PNG; const { GIFEncoder, quantize, applyPalette } = require("gifenc"); const { performance } = require("perf_hooks"); +const { execSync } = require("child_process"); + // // DEFINITIONS // @@ -490,6 +492,15 @@ program program.parse(process.argv); const main = async () => { + try { + const vulkanCheck = execSync("vulkaninfo --summary", { encoding: "utf-8" }); + console.log("=== VULKAN CHECK ==="); + console.log(vulkanCheck); + console.log("==================="); + } catch (e) { + console.error("Vulkan check failed:", e.message); + } + // global definitions let capture, captureName, @@ -669,25 +680,14 @@ const main = async () => { } // TEMP - check if WebGPU is available - const adapterInfo = await page.evaluate(async () => { - if (!navigator.gpu) return { error: "No GPU API" }; - - const adapter = await navigator.gpu.requestAdapter(); - if (!adapter) return { error: "No adapter returned" }; - - const info = await adapter.requestAdapterInfo(); - const limits = adapter.limits; - - return { - vendor: info.vendor, - architecture: info.architecture, - device: info.device, - description: info.description, - maxTextureDimension2D: limits.maxTextureDimension2D, - }; + const gpuStatus = await page.evaluate(() => { + return navigator.userAgent; }); + console.log("User agent:", gpuStatus); - console.log("WebGPU Adapter Info:", JSON.stringify(adapterInfo, null, 2)); + await page.goto("chrome://gpu"); + const gpuInfo = await page.content(); + console.log("GPU Info:", gpuInfo.substring(0, 2000)); // ------------------------------------------------------------ // EXTRACT FEATURES From af0dd3aa4de8056211832479f7973618ac84ab9f Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 11:20:01 +0000 Subject: [PATCH 06/10] even more webgpu debugging --- index.js | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index f93d238..49ca425 100644 --- a/index.js +++ b/index.js @@ -492,15 +492,38 @@ program program.parse(process.argv); const main = async () => { + // At the start of main(), before launching browser + console.log("=== GPU DIAGNOSTICS ==="); + + try { + const nvidiaSmi = execSync("nvidia-smi", { encoding: "utf-8" }); + console.log("nvidia-smi:", nvidiaSmi); + } catch (e) { + console.error("nvidia-smi failed:", e.message); + } + + try { + const libs = execSync('find /usr -name "libGLX_nvidia.so*" 2>/dev/null', { + encoding: "utf-8", + }); + console.log("NVIDIA GLX libraries found at:", libs); + } catch (e) { + console.error("Could not find NVIDIA libraries"); + } + try { - const vulkanCheck = execSync("vulkaninfo --summary", { encoding: "utf-8" }); - console.log("=== VULKAN CHECK ==="); - console.log(vulkanCheck); - console.log("==================="); + const nvidiaLibs = execSync( + 'ls -la /usr/local/nvidia/lib64/ 2>/dev/null || echo "not found"', + { encoding: "utf-8" } + ); + console.log("NVIDIA lib64 contents:", nvidiaLibs); } catch (e) { - console.error("Vulkan check failed:", e.message); + console.error("NVIDIA lib64 check failed"); } + console.log("VK_ICD_FILENAMES:", process.env.VK_ICD_FILENAMES); + console.log("======================="); + // global definitions let capture, captureName, From 9a8bd0269ec3b1bb6867046d6cad013f93f3b403 Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 11:34:00 +0000 Subject: [PATCH 07/10] still more webgpu debugging --- Dockerfile.v132 | 11 ++++++++--- index.js | 29 +++-------------------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/Dockerfile.v132 b/Dockerfile.v132 index fd45c75..eb7b7e0 100644 --- a/Dockerfile.v132 +++ b/Dockerfile.v132 @@ -21,10 +21,15 @@ RUN apt-get install -y \ libvulkan1 \ vulkan-tools -# create Vulkan ICD config to use NVIDIA driver from host +# create Vulkan ICD config pointing to the right NVIDIA Vulkan driver RUN mkdir -p /etc/vulkan/icd.d && \ - echo '{ "file_format_version": "1.0.0", "ICD": { "library_path": "libGLX_nvidia.so.0", "api_version": "1.3.0" } }' \ - > /etc/vulkan/icd.d/nvidia_icd.json + echo '{ \ + "file_format_version": "1.0.0", \ + "ICD": { \ + "library_path": "libnvidia-glvkspirv.so.580.95.05", \ + "api_version": "1.3.0" \ + } \ + }' > /etc/vulkan/icd.d/nvidia_icd.json # set node source RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh diff --git a/index.js b/index.js index 49ca425..0fe97f0 100644 --- a/index.js +++ b/index.js @@ -492,38 +492,15 @@ program program.parse(process.argv); const main = async () => { - // At the start of main(), before launching browser - console.log("=== GPU DIAGNOSTICS ==="); - - try { - const nvidiaSmi = execSync("nvidia-smi", { encoding: "utf-8" }); - console.log("nvidia-smi:", nvidiaSmi); - } catch (e) { - console.error("nvidia-smi failed:", e.message); - } - try { - const libs = execSync('find /usr -name "libGLX_nvidia.so*" 2>/dev/null', { + const vulkanLibs = execSync('find /usr -name "*vulkan*.so*" 2>/dev/null', { encoding: "utf-8", }); - console.log("NVIDIA GLX libraries found at:", libs); + console.log("Vulkan libraries:", vulkanLibs); } catch (e) { - console.error("Could not find NVIDIA libraries"); + console.error("Vulkan lib search failed"); } - try { - const nvidiaLibs = execSync( - 'ls -la /usr/local/nvidia/lib64/ 2>/dev/null || echo "not found"', - { encoding: "utf-8" } - ); - console.log("NVIDIA lib64 contents:", nvidiaLibs); - } catch (e) { - console.error("NVIDIA lib64 check failed"); - } - - console.log("VK_ICD_FILENAMES:", process.env.VK_ICD_FILENAMES); - console.log("======================="); - // global definitions let capture, captureName, From 32a96ddd01f9e103df26a429a3e00432d82823f4 Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 11:48:50 +0000 Subject: [PATCH 08/10] more more more webgpu debugging --- Dockerfile.v132 | 7 +++++-- index.js | 21 ++++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Dockerfile.v132 b/Dockerfile.v132 index eb7b7e0..f8f7428 100644 --- a/Dockerfile.v132 +++ b/Dockerfile.v132 @@ -21,16 +21,19 @@ RUN apt-get install -y \ libvulkan1 \ vulkan-tools -# create Vulkan ICD config pointing to the right NVIDIA Vulkan driver +# point to NVIDIA's Vulkan driver (should be mounted by runtime) RUN mkdir -p /etc/vulkan/icd.d && \ echo '{ \ "file_format_version": "1.0.0", \ "ICD": { \ - "library_path": "libnvidia-glvkspirv.so.580.95.05", \ + "library_path": "libGLX_nvidia.so.0", \ "api_version": "1.3.0" \ } \ }' > /etc/vulkan/icd.d/nvidia_icd.json +# add LD_LIBRARY_PATH to help find NVIDIA libs +ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/usr/local/nvidia/lib:${LD_LIBRARY_PATH} + # set node source RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh RUN bash nodesource_setup.sh diff --git a/index.js b/index.js index 0fe97f0..89324ef 100644 --- a/index.js +++ b/index.js @@ -493,12 +493,23 @@ program.parse(process.argv); const main = async () => { try { - const vulkanLibs = execSync('find /usr -name "*vulkan*.so*" 2>/dev/null', { - encoding: "utf-8", - }); - console.log("Vulkan libraries:", vulkanLibs); + const hostICD = execSync( + 'cat /usr/share/vulkan/icd.d/*.json 2>/dev/null || echo "none"', + { encoding: "utf-8" } + ); + console.log("Host ICDs:", hostICD); + } catch (e) { + console.error("ICD check failed"); + } + + try { + const nvidiaVk = execSync( + 'find / -name "*nvidia*" -path "*/vulkan/*" 2>/dev/null | head -20', + { encoding: "utf-8" } + ); + console.log("NVIDIA Vulkan files:", nvidiaVk); } catch (e) { - console.error("Vulkan lib search failed"); + console.error("No NVIDIA Vulkan found"); } // global definitions From 9a94ccbfea845300b229849a3c98b9ea064a14a7 Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 12:15:24 +0000 Subject: [PATCH 09/10] check for vulkan driver --- index.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/index.js b/index.js index 89324ef..d060157 100644 --- a/index.js +++ b/index.js @@ -493,24 +493,12 @@ program.parse(process.argv); const main = async () => { try { - const hostICD = execSync( - 'cat /usr/share/vulkan/icd.d/*.json 2>/dev/null || echo "none"', + const nvidiaVulkan = execSync( + 'find /usr -name "*nvidia*vulkan*" -o -name "*vk_swiftshader*" 2>/dev/null', { encoding: "utf-8" } ); - console.log("Host ICDs:", hostICD); - } catch (e) { - console.error("ICD check failed"); - } - - try { - const nvidiaVk = execSync( - 'find / -name "*nvidia*" -path "*/vulkan/*" 2>/dev/null | head -20', - { encoding: "utf-8" } - ); - console.log("NVIDIA Vulkan files:", nvidiaVk); - } catch (e) { - console.error("No NVIDIA Vulkan found"); - } + console.log("NVIDIA Vulkan search:", nvidiaVulkan); + } catch (e) {} // global definitions let capture, From 5f998ceddaf10c8419ad012706c5ffede5436db1 Mon Sep 17 00:00:00 2001 From: Louis Holley Date: Wed, 10 Dec 2025 12:32:08 +0000 Subject: [PATCH 10/10] try opengles for webgpu --- Dockerfile.v132 | 21 --------------------- index.js | 25 +------------------------ 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/Dockerfile.v132 b/Dockerfile.v132 index f8f7428..fe056b3 100644 --- a/Dockerfile.v132 +++ b/Dockerfile.v132 @@ -16,24 +16,6 @@ RUN wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-sta apt-mark hold google-chrome-stable && \ rm google-chrome.deb -# add vulkan support -RUN apt-get install -y \ - libvulkan1 \ - vulkan-tools - -# point to NVIDIA's Vulkan driver (should be mounted by runtime) -RUN mkdir -p /etc/vulkan/icd.d && \ - echo '{ \ - "file_format_version": "1.0.0", \ - "ICD": { \ - "library_path": "libGLX_nvidia.so.0", \ - "api_version": "1.3.0" \ - } \ - }' > /etc/vulkan/icd.d/nvidia_icd.json - -# add LD_LIBRARY_PATH to help find NVIDIA libs -ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/usr/local/nvidia/lib:${LD_LIBRARY_PATH} - # set node source RUN curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh RUN bash nodesource_setup.sh @@ -58,9 +40,6 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_DRIVER_CAPABILITIES all -# vulkan env vars -ENV VK_ICD_FILENAMES=/etc/vulkan/icd.d/nvidia_icd.json - # setup modules & project WORKDIR /app RUN rm -rf * diff --git a/index.js b/index.js index d060157..647c394 100644 --- a/index.js +++ b/index.js @@ -7,8 +7,6 @@ const PNG = require("pngjs").PNG; const { GIFEncoder, quantize, applyPalette } = require("gifenc"); const { performance } = require("perf_hooks"); -const { execSync } = require("child_process"); - // // DEFINITIONS // @@ -492,14 +490,6 @@ program program.parse(process.argv); const main = async () => { - try { - const nvidiaVulkan = execSync( - 'find /usr -name "*nvidia*vulkan*" -o -name "*vk_swiftshader*" 2>/dev/null', - { encoding: "utf-8" } - ); - console.log("NVIDIA Vulkan search:", nvidiaVulkan); - } catch (e) {} - // global definitions let capture, captureName, @@ -602,9 +592,7 @@ const main = async () => { "--use-cmd-decoder=passthrough", // enable webgpu "--enable-unsafe-webgpu", - "--enable-features=Vulkan", - "--use-webgpu-adapter=vulkan", - "--enable-dawn-features=allow_unsafe_apis", + "--use-webgpu-adapter=opengles", ], executablePath: process.env.PUPPETEER_EXECUTABLE_PATH, }); @@ -678,17 +666,6 @@ const main = async () => { throw ERRORS.CANVAS_CAPTURE_FAILED; } - // TEMP - check if WebGPU is available - const gpuStatus = await page.evaluate(() => { - return navigator.userAgent; - }); - console.log("User agent:", gpuStatus); - - await page.goto("chrome://gpu"); - const gpuInfo = await page.content(); - console.log("GPU Info:", gpuInfo.substring(0, 2000)); - // ------------------------------------------------------------ - // EXTRACT FEATURES console.log("extracting features..."); // find $fxhashFeatures in the window object