Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: terminator_CreateInstance: Failed to CreateInstance in ICD2. Skipping ICD #30401

Open
weiners4 opened this issue Oct 11, 2024 · 6 comments
Labels
stage: needs investigating Someone from Cypress needs to look at this type: error message

Comments

@weiners4
Copy link

weiners4 commented Oct 11, 2024

Current behavior

I observed the following warning/error when running tests using Cypress v13.13.1 installed locally on RHEL v8.10 VM and also when using the Cypress:Included image v13.13.1 running Debian GNU/Linux 12

Warning: terminator_CreateInstance: Failed to CreateInstance in ICD2. Skipping ICD
Error: Loader Message: setup_loader_term_phys_devs: Failed to detect any vaild GPUs in the current config
Warning: vkEnumeratePhysicalDevices
 at GatherPhysicalDevices (../../vulkanInfo.cpp:131)
 at Initialize (../../BackendVk.cpp:353)
 at Create (../../BackendVk.cpp:266)
 at operator() (../../BackendVk.cpp:521)

As far as I can tell, the warning/error does not impact test execution or degrade performance as the tests still run to completion and the time duration of test execution is not increasing. I observed the warning/error being displayed from 1-3 times when running tests from the CLI in headless mode. The only pattern seems to be that the warning/error is displayed to stdout when running multiple tests in a group (eg. all E2E or API). If the tests are run one at a time independently then I never see this warning/error.

Desired behavior

The desired behavior is, if possible, to suppress these warnings/errors because they lead to confusion about whether there was a problem during test execution.

Test code to reproduce

I don't have the ability to publish a repo or my test specs or Cypress configuration.

Cypress Version

v13.13.1

Node version

v18.18.2 and v20.5.1

Operating System

RHEL v8.10 and Debian GNU/Linux 12

Debug Logs

I turned on the debugging in Cypress, but the debug didn't lend any clues as to what was the root cause of the warning/error

Other

I did a number of things to try and troubleshoot the root cause of the warning/error and was able to resolve the issue as per the explanation below. After making the changes described below, I do not see the error/warning anymore. The root cause appears to be how the Vulkan drivers are installed.
-The Vulkan Loader provides an Installable Client Driver (ICD), which supports systems that have multiple GPUs and enables control over how the GPUs work. The Vulkan driver can be installed as Explicit, Implicit or ICD Manifest type. On my VM, the driver appears to have been installed as the Implicit Layer Manifest type because the driver file is located in /usr/share/vulkan/implicit_layer.d/. However when running Cypress tests, Cypress appears to be looking for what is known as the ICD Manifest type driver file and that file would be located in /usr/share/vulkan/icd.d/. There was no file in that directory on my VM, so I created a driver file and placed the file in that location as explained below.

-Several driver files were located in /usr/share/vulkan/implicit_layer.d/. Based on doing a search for RPMs with vulkan in the name (rpm -qa | grep -i vulkan) on my system, I determined that the mesa-vulkan-drivers were installed. The driver file installed in the implicit_layer.d/ directory was VkLayer_MESA_device_select.json

--I created a new file with the same name in the icd.d/ directory
--The file should have root as the owner:group and permissions of 644, just like the other driver files in icd.d/
--The content of the new driver file created in icd.d/ was similar to the other driver files in icd.d/. In the new driver file the api_version and library_path were updated to match what was found in the driver file in implicit_layer.d/VkLayer_MESA_device_select.json

--The location and name of the new driver file is /usr/share/vulkan/icd.d/VkLayer_MESA_device_select.json
--The content of the json file is shown below (normal json indentation not shown)
--Once this file is created with the required content and placed in the icd.d/ directory the warning/error should no longer be displayed to stdout during test execution

Note that for library_path the fullpath to the driver shared object file is used
{
"ICD": {
"api_version": "1.3.211"
"library_path": "/usr/lib64/libVkLayer_MESA_device_select.so"
},
"file_format_version": "1.0.0"
}

@weiners4
Copy link
Author

Should these be linked to both:
#29278
#29085

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Oct 14, 2024

@weiners4

I have also seen the message occurring from time to time, without the warning interrupting test execution:

Warning: terminator_CreateInstance: Failed to CreateInstance in ICD2. Skipping ICD

I would assume that it is another "garbage warning" like the following may also be:

Typically, these warnings either need to be suppressed in cli/lib/exec/spawn.js or they go away when Electron is updated (which sometimes introduces new garbage warnings!).

  • chore: upgrade electron to 32.2.0 #30394 is being worked out to make a major leap from Electron 27.3.10 to 32.2.0, so I expect that we need to wait and see how this behaves. It's planned to be part of the next major release.

The issues you quoted are related, and useful as background reading, however they are already closed:

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Oct 14, 2024

Confirmed with Cypress 13.15.0 in Ubuntu 22.04.1 LTS with Node.js v20.12.0 under VMware Workstation 17.6.1

For example using https://github.com/cypress-io/cypress-realworld-app:

  Running:  ui/notifications.spec.ts                                                      (14 of 21)


  Notifications
Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 4.  Skipping ICD.
    ✓ renders an empty notifications state (2641ms)
    notifications from user interactions
      ✓ User A likes a transaction of User B; User B gets notification that User A liked transaction  (4802ms)
      ✓ User C likes a transaction between User A and User B; User A and User B get notifications that User C liked transaction (4824ms)
      ✓ User A comments on a transaction of User B; User B gets notification that User A commented on their transaction (3308ms)
      ✓ User C comments on a transaction between User A and User B; User A and B get notifications that User C commented on their transaction (5195ms)
      ✓ User A sends a payment to User B (3070ms)
      ✓ User A sends a payment request to User C (2380ms)

In this environment:

$ sudo apt install vulkan-tools
$ vulkaninfo --summary
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/x86_64-linux-gnu/libvulkan_virtio.so. Skipping this driver.

Also seeing this warning running Ubuntu directly on laptop x86 hardware (with GPU).

@jennifer-shehane jennifer-shehane added type: error message stage: needs investigating Someone from Cypress needs to look at this labels Nov 5, 2024
@jordi72
Copy link

jordi72 commented Nov 11, 2024

I'm suffering this issue in Cypress 13.15.1 in Ubuntu 22.04.1 LTS with NodeJS 22.10.0 inside Azure Devops

Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 4. Skipping ICD.

After this message, almost everything starts to crash.

I'm running Cypress in Chrome 130.x.x headless
With this export in the pipeline prior to the execution of cypress, trying to minimize this issue: export XDG_RUNTIME_DIR=/tmp/runtime

@MikeMcC399
Copy link
Contributor

@jordi72

Based on previous similar GPU-related error messages and the fact that https://github.com/cypress-io/cypress-realworld-app runs successfully to completion, even though it emits the warning message, there seems to be a high likelihood that this is a garbage error and that test failures aren't actually caused by the warning.

I ran the same test mentioned above in #30401 (comment) using a beta version of Cypress 14.0.0 from bd89ca7 and the error message was no longer output. The tests also ran successfully to completion.

Cypress 14 beta updates the version of Electron, and I assume that this has caused the warning message to disappear. Again, just based on gut-feel and previous experience. This hasn't been announced for testing yet, but anybody can follow the instructions on https://docs.cypress.io/app/references/advanced-installation#Install-pre-release-version to install a pre-release version for testing purposes. The branch is release/14.0.0, not the develop branch.

@joelgrimberg
Copy link

I experience the same error in my Azure Devops setup.

I do not run Docker in Docker at. this moment, so I am manually configuring my Azure agent Running Ubuntu 24.04 LTS on which I I manually installed Chromium 131.

CleanShot 2024-12-11 at 09 37 51@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: error message
Projects
None yet
Development

No branches or pull requests

5 participants