canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.35k stars 931 forks source link

lxc GLX blit vs. flip #5988

Closed mismacku closed 5 years ago

mismacku commented 5 years ago

Let me first say, thanks for all of the hard work!
I'm revisiting an issue from several years ago because I really want this to work! https://github.com/lxc/lxd/issues/3826
^^^ That issue being poor framerate with GLX apps in lxc containers. I'm getting similar framerates as I did two years ago, but I discovered that on the host the nvidia driver always shows FLIP and in lxc containers (Ubuntu 16.04 and 18.04) it shows BLIT regardless of what nvidia-settings shows (Attribute 'AllowFlipping' (test-rig:0.0): 1). I'm guessing that was the performance issue then and still is now. Any ideas? Any help is greatly appreciated.

Steps to reproduce

  1. using nvidia-settings under OpenGL Settings, tick Enable Graphics API Visual Indicator
  2. Use the lxc profile above
  3. start an Ubuntu 18.04 container
  4. apt install glmark2
  5. run glmark (glmark2 --fullscreen)
  6. notice the visual indicator shows BLIT - VSYNC OFF Note: the VI shows BLIT regardless of the GLX app I'm running (glxgears, glmark2, in-house GLX apps)

    Information to attach

    container log:

    
    lxc info --show-log test1804
    Name: test1804
    Location: none
    Remote: unix://
    Architecture: x86_64
    Created: 2019/07/18 14:54 UTC
    Status: Running
    Type: persistent
    Profiles: default
    Pid: 9388
    Ips:
    eth0: inet    10.137.124.115
    eth0: inet6   fe80::216:3eff:fe53:8224
    lo:   inet    127.0.0.1
    lo:   inet6   ::1
    Resources:
    Processes: 25
    Disk usage:
    root: 147.16MB
    CPU usage:
    CPU usage (in seconds): 10
    Memory usage:
    Memory (current): 76.13MB
    Memory (peak): 124.46MB
    Network usage:
    eth0:
      Bytes received: 325.03kB
      Bytes sent: 2.13kB
      Packets received: 2798
      Packets sent: 22
    lo:
      Bytes received: 332B
      Bytes sent: 332B
      Packets received: 4
      Packets sent: 4

Log:

lxc test1804 20190718161841.826 ERROR start - start.c:proc_pidfd_open:1644 - Function not implemented - Failed to send signal through pidfd


`lxc monitor` shows nothing.
stgraber commented 5 years ago

Hmm, so LXD doesn't interact with the graphics driver in any way. All it does is pass /dev/drm/ and /dev/nvidia* to the container.

I'd recommend maybe opening an issue with https://github.com/NVIDIA/libnvidia-container as that's what's used to pass the various GL libraries. Maybe your issue is caused by a missing library or something similar.

mismacku commented 5 years ago

I'll open an issue there. Thanks Stephane!

stgraber commented 5 years ago

Perfect, thanks!