From 96b14c3e1762a253aac0d0413a2b3b5c1ee4d954 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Wed, 10 Apr 2024 13:12:23 -0400 Subject: [PATCH] misc: suppress benign vulkan warnings (#29278) * fix: suppress benign vulkan warnings * changelog; make garbage warnings visible via verbose debug * update changelog * bump circle cache * update regex --------- Co-authored-by: Jennifer Shehane --- cli/CHANGELOG.md | 1 + cli/lib/exec/spawn.js | 34 ++++++++++++++++++++++++++++++++- cli/test/lib/exec/spawn_spec.js | 13 +++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 180cf5ceaf59..3e390fb4bd8e 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -6,6 +6,7 @@ _Released 4/16/2024 (PENDING)_ **Misc:** - Updated the Chrome flags to not show the "Enhanced Ad Privacy" dialog. Addresses [#29199](https://github.com/cypress-io/cypress/issues/29199). +- Suppresses benign warnings that reference Vulkan on GPU-less hosts. Addresses [#29085](https://github.com/cypress-io/cypress/issues/29085). Addressed in [#29278](https://github.com/cypress-io/cypress/pull/29278). **Bugfixes:** diff --git a/cli/lib/exec/spawn.js b/cli/lib/exec/spawn.js index dabf8f6a3233..e132b964e0a3 100644 --- a/cli/lib/exec/spawn.js +++ b/cli/lib/exec/spawn.js @@ -4,6 +4,7 @@ const cp = require('child_process') const path = require('path') const Promise = require('bluebird') const debug = require('debug')('cypress:cli') +const debugVerbose = require('debug')('cypress-verbose:cli') const util = require('../util') const state = require('../tasks/state') @@ -43,7 +44,36 @@ const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^----- // objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined. const isMacOSElectronWebSwapCGLLayerWarning = /^objc\[\d+\]: Class WebSwapCGLLayer is implemented in both.*Which one is undefined\./ -const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning] +/** + * Electron logs benign warnings about Vulkan when run on hosts that do not have a GPU. This is coming from the primary Electron process, + * and not the browser being used for tests. + * Samples: + * Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_intel.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7) + * Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_lvp.so supports Vulkan 1.1, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7) + * Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this verison of Vulkan (Policy #LDP_DRIVER_7) + * Warning: Layer VK_LAYER_MESA_device_select uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues. + */ + +const isHostVulkanDriverWarning = /^Warning:.+(#LDP_DRIVER_7|VK_LAYER_MESA_device_select).+/ + +/** + * Electron logs benign warnings about Vulkan when run in docker containers whose host does not have a GPU. This is coming from the primary + * Electron process, and not the browser being used for tests. + * Sample: + * Warning: vkCreateInstance: Found no drivers! + * Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER + * at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88) + * at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:458) + * at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344) + * at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266) + * at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521) + */ + +const isContainerVulkanDriverWarning = /^Warning: vkCreateInstance/ + +const isContainerVulkanStack = /^\s*at (CheckVkSuccessImpl|CreateVkInstance|Initialize|Create|operator).+(VulkanError|BackendVk).cpp/ + +const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning, isHostVulkanDriverWarning, isContainerVulkanDriverWarning, isContainerVulkanStack] const isGarbageLineWarning = (str) => { return _.some(GARBAGE_WARNINGS, (re) => { @@ -230,6 +260,8 @@ module.exports = { // bail if this is warning line garbage if (isGarbageLineWarning(str)) { + debugVerbose(str) + return } diff --git a/cli/test/lib/exec/spawn_spec.js b/cli/test/lib/exec/spawn_spec.js index 6725e0c1c9c7..26ad6d6713e7 100644 --- a/cli/test/lib/exec/spawn_spec.js +++ b/cli/test/lib/exec/spawn_spec.js @@ -77,6 +77,19 @@ describe('lib/exec/spawn', function () { ERROR: No matching issuer found objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined. + + Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_intel.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7) + Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_lvp.so supports Vulkan 1.1, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7) + Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this verison of Vulkan (Policy #LDP_DRIVER_7) + Warning: Layer VK_LAYER_MESA_device_select uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues. + + Warning: vkCreateInstance: Found no drivers! + Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER + at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88) + at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:458) + at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344) + at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266) + at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521) ` const lines = _