Skip to content

Commit 96b14c3

Browse files
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 <jennifer@cypress.io>
1 parent 5251d2b commit 96b14c3

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ _Released 4/16/2024 (PENDING)_
66
**Misc:**
77

88
- Updated the Chrome flags to not show the "Enhanced Ad Privacy" dialog. Addresses [#29199](https://github.com/cypress-io/cypress/issues/29199).
9+
- 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).
910

1011
**Bugfixes:**
1112

cli/lib/exec/spawn.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const cp = require('child_process')
44
const path = require('path')
55
const Promise = require('bluebird')
66
const debug = require('debug')('cypress:cli')
7+
const debugVerbose = require('debug')('cypress-verbose:cli')
78

89
const util = require('../util')
910
const state = require('../tasks/state')
@@ -43,7 +44,36 @@ const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^-----
4344
// 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.
4445
const isMacOSElectronWebSwapCGLLayerWarning = /^objc\[\d+\]: Class WebSwapCGLLayer is implemented in both.*Which one is undefined\./
4546

46-
const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning]
47+
/**
48+
* Electron logs benign warnings about Vulkan when run on hosts that do not have a GPU. This is coming from the primary Electron process,
49+
* and not the browser being used for tests.
50+
* Samples:
51+
* 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)
52+
* 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)
53+
* 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)
54+
* 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.
55+
*/
56+
57+
const isHostVulkanDriverWarning = /^Warning:.+(#LDP_DRIVER_7|VK_LAYER_MESA_device_select).+/
58+
59+
/**
60+
* Electron logs benign warnings about Vulkan when run in docker containers whose host does not have a GPU. This is coming from the primary
61+
* Electron process, and not the browser being used for tests.
62+
* Sample:
63+
* Warning: vkCreateInstance: Found no drivers!
64+
* Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
65+
* at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
66+
* at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:458)
67+
* at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
68+
* at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
69+
* at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)
70+
*/
71+
72+
const isContainerVulkanDriverWarning = /^Warning: vkCreateInstance/
73+
74+
const isContainerVulkanStack = /^\s*at (CheckVkSuccessImpl|CreateVkInstance|Initialize|Create|operator).+(VulkanError|BackendVk).cpp/
75+
76+
const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning, isHostVulkanDriverWarning, isContainerVulkanDriverWarning, isContainerVulkanStack]
4777

4878
const isGarbageLineWarning = (str) => {
4979
return _.some(GARBAGE_WARNINGS, (re) => {
@@ -230,6 +260,8 @@ module.exports = {
230260

231261
// bail if this is warning line garbage
232262
if (isGarbageLineWarning(str)) {
263+
debugVerbose(str)
264+
233265
return
234266
}
235267

cli/test/lib/exec/spawn_spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ describe('lib/exec/spawn', function () {
7777
ERROR: No matching issuer found
7878
7979
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.
80+
81+
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)
82+
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)
83+
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)
84+
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.
85+
86+
Warning: vkCreateInstance: Found no drivers!
87+
Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
88+
at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
89+
at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:458)
90+
at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
91+
at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
92+
at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)
8093
`
8194

8295
const lines = _

0 commit comments

Comments
 (0)