NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.88k stars 13.94k forks source link

[vmware-guest] Graphical Issues in NixOS as VMware Guest Machine (mostly chromium and vscode) #239598

Open ocelik94 opened 1 year ago

ocelik94 commented 1 year ago

Hello, I am using NixOS on my guest machine, and I am experiencing some graphic related issues. Those issues seem to be related to chromium and electron (vscode) as I could see it only in those applications so far. You should look at the screenshots below, as those should explain my problem pretty good.

I did the following things:

I even have this issue in the gnome live-iso!

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create Guest with VMware
  2. Run Gnome Live Iso of NixOS
  3. Install VSCode with nix-shell vscode and you should experience my problem

This issue is definitly related to nixos! My setup is working flawless on arch and fedora

Screenshots

image image

Metadata

> nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.3.9, NixOS, 23.11 (Tapir), 23.11.20230623.3ae20aa`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.15.1`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
> inxi -Fz             
System:    Kernel: 6.3.9 x86_64 bits: 64 Desktop: N/A Distro: NixOS 23.11 (Tapir) 
Machine:   Type: Vmware System: VMware product: VMware20,1 v: N/A serial: <filter> 
           Mobo: Intel model: 440BX Desktop Reference Platform serial: <filter> UEFI: VMware 
           v: VMW201.00V.20904234.B64.2212051119 date: 12/05/2022 
CPU:       Info: 16-Core model: 12th Gen Intel Core i9-12900K bits: 64 type: MCP cache: L2: 30 MiB 
           Speed: 3187 MHz min/max: N/A Core speeds (MHz): 1: 3187 2: 3187 3: 3187 4: 3187 5: 3187 6: 3187 7: 3187 8: 3187 
           9: 3187 10: 3187 11: 3187 12: 3187 13: 3187 14: 3187 15: 3187 16: 3187 
Graphics:  Message: No device data found. 
           Display: x11 server: X.org 1.21.1.8 driver: loaded: vmware resolution: <missing: xdpyinfo> 
           OpenGL: renderer: SVGA3D; build: RELEASE; LLVM; v: 4.3 Mesa 23.1.2 
Audio:     Device-1: Ensoniq AudioPCI driver: ENS1371 
           Sound Server-1: ALSA v: k6.3.9 running: yes 
           Sound Server-2: PipeWire v: 0.3.71 running: yes 
Network:   Message: No device data found. 
           IF-ID-1: ens33 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 256 GiB used: 14.78 GiB (5.8%) 
           ID-1: /dev/nvme0n1 vendor: VMware model: Virtual NVMe Disk VMware NVME size: 256 GiB 
Partition: ID-1: / size: 250.42 GiB used: 14.68 GiB (5.9%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: /boot size: 511 MiB used: 98.8 MiB (19.3%) fs: vfat dev: /dev/nvme0n1p1 
Swap:      Alert: No swap data was found. 
Sensors:   Missing: Required tool sensors not installed. Check --recommends 
Info:      Processes: 315 Uptime: N/A Memory: 27.19 GiB used: 1.47 GiB (5.4%) Shell: Zsh inxi: 3.3.04 
> glxinfo -B           
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: VMware, Inc. (0x15ad)
    Device: SVGA3D; build: RELEASE;  LLVM; (0x405)
    Version: 23.1.2
    Accelerated: no
    Video memory: 1MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.3
    Max compat profile version: 4.3
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: SVGA3D; build: RELEASE;  LLVM;
OpenGL core profile version string: 4.3 (Core Profile) Mesa 23.1.2
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.3 (Compatibility Profile) Mesa 23.1.2
OpenGL shading language version string: 4.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 23.1.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
ocelik94 commented 1 year ago

Downgrading Linux Kernel to 5.4 seems to be a workaround. Any idea?

kjeremy commented 1 year ago

I've been experiencing this for about two years now. Disabling gpu acceleration seems to workaround it: ie code --disable-gpu for example runs vscode with software rendering and that seems to work fine.

ocelik94 commented 1 year ago

Hi @kjeremy,

As I am not facing this problem on arch it must exist a fix.

Disabling GPU in the browser makes it unusable. afaik everything web-based seems to have this issue.

Using iGPU also resolves this problem so it must be related to nvidia. In https://github.com/vmware/open-vm-tools/issues/674 I got recommended to compare the nixos package of open-vm-tools

ocelik94 commented 1 year ago

One possibility is the version of xf86videovmware which nixos is using. In Arch it is 13.4.0 and nixos is uing 13.3.0

Also I am starting to face this issue with kernel 5_10. Up to 5_4 there are no issues

kjeremy commented 1 year ago

There are 5 years of differences between those versions. I'll submit a PR for the driver update.

chasecaleb commented 1 year ago

@ocelik94 Did you ever get hardware acceleration working by any chance? Because I haven't tried in a while but want to get it working as well if it's possible.

ocelik94 commented 1 year ago

@chasecaleb Unfortunately, I have not found a solution and have therefore changed to an older Linux kernel.

emilylange commented 9 months ago

We have fixed some bugs regarding GPU and rendering lately.

Can someone check and report back whether this issue is still present in recent versions?

lloeki commented 7 months ago

Setting the env var WEBKIT_DISABLE_COMPOSITING_MODE=1 may be a softer way to work around working across the board.

I'm having similar issues with VMware (Fusion on Aarch64), everything appears to work yet it doesn't (it used to work before an update I can't pinpoint)...

Kernel is happy:

$ dmesg | grep vmwgfx
[    2.194523] vmwgfx 0000:00:0f.0: [drm] Register MMIO at 0x0x000000003d000000 size is 4096 kiB
[    2.194527] vmwgfx 0000:00:0f.0: [drm] VRAM at 0x0000000070000000 size is 131072 kiB
[    2.194532] vmwgfx 0000:00:0f.0: [drm] Running on SVGA version 3.
[    2.194535] vmwgfx 0000:00:0f.0: [drm] Capabilities: cursor, cursor bypass, alpha cursor, 3D, pitchlock, irq mask, traces, command buffers, command buffers 2, gbobject, dx, hp cmd queue, no bb restriction, cap2 register, 
[    2.194538] vmwgfx 0000:00:0f.0: [drm] Capabilities2: grow otable, intra surface copy, dx2, gb memsize 2, screendma reg, otable ptdepth2, non ms to ms stretchblt, cursor mob, mshint, cb max size 4mb, dx3, frame type, trace full fb, extra regs, lo staging, 
[    2.194538] vmwgfx 0000:00:0f.0: [drm] DMA map mode: Caching DMA mappings.
[    2.194578] vmwgfx 0000:00:0f.0: [drm] Legacy memory limits: VRAM = 4096 kB, FIFO = 256 kB, surface = 524288 kB
[    2.194579] vmwgfx 0000:00:0f.0: [drm] MOB limits: max mob size = 1048576 kB, max mob pages = 524288
[    2.194581] vmwgfx 0000:00:0f.0: [drm] Maximum display memory size is 262144 kiB
[    2.199207] vmwgfx 0000:00:0f.0: [drm] No GMR memory available. Graphics memory resources are very limited.
[    2.199266] vmwgfx 0000:00:0f.0: [drm] Screen Target display unit initialized
[    2.199604] vmwgfx 0000:00:0f.0: [drm] Using command buffers with DMA pool.
[    2.199613] vmwgfx 0000:00:0f.0: [drm] Available shader model: SM_5_1X.
[    2.200016] [drm] Initialized vmwgfx 2.20.0 20211206 for 0000:00:0f.0 on minor 0
[    2.202553] vmwgfx 0000:00:0f.0: [drm] fb0: vmwgfxdrmfb frame buffer device

mesa tool looks good (I guess? is this supposed to say Gallium on SVGA3D these days?):

$ nix-shell -p glxinfo --run 'env LIBGL_DEBUG=verbose glxinfo -B'
name of display: :0
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/lloeki/.drirc: No such file or directory.
using driver vmwgfx for 4
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/lloeki/.drirc: No such file or directory.
pci id for fd 4: 15ad:0406, driver vmwgfx
MESA-LOADER: dlopen(/run/opengl-driver/lib/dri/vmwgfx_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/lloeki/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/lloeki/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/lloeki/.drirc: No such file or directory.
Using DRI3 for screen 0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: VMware, Inc. (0x15ad)
    Device: SVGA3D; build: RELEASE;  LLVM; (0x406)
    Version: 24.0.2
    Accelerated: no
    Video memory: 1MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.3
    Max compat profile version: 4.3
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: SVGA3D; build: RELEASE;  LLVM;
OpenGL core profile version string: 4.3 (Core Profile) Mesa 24.0.2
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.3 (Compatibility Profile) Mesa 24.0.2
OpenGL shading language version string: 4.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 24.0.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

But it seems like everything else falls back to software rendering via llvmpipe or something.

Strangely every driver seems to symlink to armada?

$ ls -l /run/opengl-driver/lib/dri/
total 47092
-r-xr-xr-x 1 root root 31545632 Jan  1  1970 armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 d3d12_dri.so -> armada-drm_dri.so
-r-xr-xr-x 1 root root 16671728 Jan  1  1970 d3d12_drv_video.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 etnaviv_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 exynos_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 gm12u320_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 hdlcd_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 hx8357d_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 ili9163_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 ili9225_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 ili9341_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 ili9486_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 imx-dcss_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 imx-drm_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 imx-lcdif_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 ingenic-drm_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 kgsl_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 kirin_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 kms_swrast_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 komeda_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 lima_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 mali-dp_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 mcde_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 mediatek_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 meson_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 mi0283qt_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 msm_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 mxsfb-drm_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 nouveau_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       18 Jan  1  1970 nouveau_drv_video.so -> d3d12_drv_video.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 panel-mipi-dbi_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 panfrost_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 pl111_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 r300_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 r600_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       18 Jan  1  1970 r600_drv_video.so -> d3d12_drv_video.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 radeonsi_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       18 Jan  1  1970 radeonsi_drv_video.so -> d3d12_drv_video.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 rcar-du_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 repaper_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 rockchip_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 st7586_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 st7735r_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 sti_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 stm_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 sun4i-drm_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 swrast_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 tegra_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 udl_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 v3d_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 vc4_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 virtio_gpu_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       18 Jan  1  1970 virtio_gpu_drv_video.so -> d3d12_drv_video.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 vmwgfx_dri.so -> armada-drm_dri.so
lrwxrwxrwx 1 root root       17 Jan  1  1970 zink_dri.so -> armada-drm_dri.so