vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

[Remote-Container Bug] Massive UI performance issues without x11 socket when using Containers in WSL2

Open Roemer opened this issue 1 year ago • 0 comments

We use Dev-Containers from inside WSL2 and need graphical applications like Cypress. When we just run our container without special mounts, Cypress gets extremely slow and uses a lot of CPU. When we also add a mount for /tmp/.X11-unix into the container, it gets massively faster.

This can also easily be verified by using glxgears from mesa-utils. Without the mount, I get 100 FPS, with the mount 1100 FPS, so more than a 10x increase.

  • VSCode Version: 1.90.2
  • Local OS Version: Windows 10
  • Remote OS Version: WSL2 Debian
  • Remote Extension/Connection Type: Container over WSL

Steps to Reproduce:

  1. Create a devcontainer.json file like:
{
  "name": "x11-socket-perf-test",
  "build": {
    "dockerfile": "Dockerfile",
  },
  "runArgs": [
    "-e", "DISPLAY=${localEnv:DISPLAY}",
    "-v", "/tmp/.X11-unix:/tmp/.X11-unix:ro"
  ]
}
  1. Create a simple Dockerfile the following content:
FROM debian
RUN apt-get update && apt-get install -y mesa-utils
  1. Start the dev-container and run glxgears. Every 5 seconds you see an FPS in the console.
  2. Close the container and remove the runArgs from devcontainer.json and rebuild the container.
  3. Start glxgears again and you will see that it is a lot slower.

Does this issue occur when you try this locally?: Yes Does this issue occur when you try this locally and all extensions are disabled?: Yes

Additional info: When I inspect the container created without my manual mount of the x11-socket, I only see a mount from /run/user/1000/wayland-0 (beside vscode/_data and the workspace).

Roemer avatar Jun 28 '24 12:06 Roemer