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

zoom-us fixes #26596

Merged
merged 2 commits into from
Jun 15, 2017
Merged

zoom-us fixes #26596

merged 2 commits into from
Jun 15, 2017

Conversation

danbst
Copy link
Contributor

@danbst danbst commented Jun 15, 2017

Motivation for this change

Fix some issues for zoom-us. In particular,

  • zoom-us: init at 2.0.91373.0502 #26446 (comment) for not working SSO (cc @kamilchm )
  • crash with Facebook
  • warnings about /home/levi/... (by fixing qt.conf)
  • black screen from webcam (my Logitech C270). This change, however, isn't as straightforward as others, so I extracted it to separate commit. If you guys ( @shlevy @k0001 @kamilchm ) have webcam working currently, and that commit breaks it for you, i'll revert it.
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Turns out, zoom couldn't launch QtWebEngineProcess because of wrong interpreter
Also, there was a need for some extra deps, which I found when
running debug version of zoom.
Webcam Logitech C270 showed black screen in zoom, but LD_PRELOADing
v4l1compat.so fixed this. I hope, this wouldn't break camera for people,
who were already able to see video, but I can't be 100% sure currently.
@shlevy
Copy link
Member

shlevy commented Jun 15, 2017

@danbst I did have webcam working, so I'll test this.

@shlevy shlevy merged commit 6d6d2fd into NixOS:master Jun 15, 2017
@kamilchm
Copy link
Member

SSO and webcam fixed. Thx!

@cstrahan
Copy link
Contributor

How exactly does zoom-us work? We're now using zoom.us at work, and I'd like to be able to connect from my NixOS machine, but when I run $(nix-build . -A zoom-us)/bin/zoom-us, all I see is this in my terminal:

zoom started.
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Unrecognized OpenGL version
Unrecognized OpenGL version

No GUI or system dock icon appears.

@k0001
Copy link
Contributor

k0001 commented Jun 27, 2017

@cstrahan you may want to check that OpenGL is working for you with other applications. Running that same command works fine for me.

@cstrahan
Copy link
Contributor

Hm... glxgears works just fine.

@cstrahan
Copy link
Contributor

I'm running xmonad without a desktop environment... Maybe that has something to do with it?

@k0001
Copy link
Contributor

k0001 commented Jun 27, 2017

@cstrahan unlikely. I was using xmonad without a desktop environment myself until some weeks ago, and even then zoom-us worked fine.

@cstrahan
Copy link
Contributor

@k0001 I'm using the closed source nvidia driver; may I ask what you're using?

@k0001
Copy link
Contributor

k0001 commented Jun 27, 2017

@cstrahan I'm using the radeon drivers. Maybe you need to add something to hardware.opengl.extraPackages in configuration.nix?

@cstrahan
Copy link
Contributor

@k0001 Ah, I wasn't aware of that option. I see with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau ] is suggested as an example setting, and I see that "vdpau" is in the binary when I grep the tree.

Out of curriousity, what do you have set for opengl.extraPackages?

@k0001
Copy link
Contributor

k0001 commented Jun 27, 2017

@cstrahan I have [ vaapiIntel ] that apparently i forgot to comment out since I'm not using an Intel video card anymore 😄

I'd expect enabling vaapiVdpau in a Nvidia system makes sense.

@cstrahan
Copy link
Contributor

Ah, if I export LIBGL_DEBUG=verbose:

zoom started.
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /run/opengl-driver/lib/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /run/opengl-driver/lib/dri/swrast_dri.so
libGL: dlopen /run/opengl-driver/lib/dri/swrast_dri.so failed (/run/opengl-driver/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
function is no-op
Unrecognized OpenGL version
Unrecognized OpenGL version

Still not sure what all I'm missing...

@k0001
Copy link
Contributor

k0001 commented Jun 27, 2017

In my case swrast_dri.so seems to come from mesa. Maybe you need to get that installed?

[k@z1:~]$ readlink -f /run/opengl-driver/lib/dri/swrast_dri.so
/nix/store/zh6v7amxyws1y6pfa7hcwhb3wph90yqc-mesa-noglu-17.0.7-drivers/lib/dri/gallium_dri.so

Also, I'm not sure if this is necessary, but with NVidia I never know: Maybe the 32 bit versions of some of these libs are required?

hardware.opengl.driSupport32Bit = true;                                                                                                                                        
hardware.opengl.extraPackages = with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau ];                                                                                           
hardware.opengl.extraPackages32 = with (pkgs.pkgsi686Linux); [ vaapiIntel libvdpau-va-gl vaapiVdpau ];

(I'm guessing, I don't really know what's going on here)

@cstrahan
Copy link
Contributor

Hmmm... So here's where the /run/opengl-drivers env is created (in nixos/modules/hardware/opengl.nix):

  makePackage = p: pkgs.buildEnv {
    name = "mesa-drivers+txc-${p.mesa_drivers.version}";
    paths =
      [ p.mesa_drivers
        p.mesa_drivers.out # mainly for libGL
        (if cfg.s3tcSupport then p.libtxc_dxtn else p.libtxc_dxtn_s2tc)
      ];
  };

  // As I'll note below, `cfg.package` defaults to the above expression,
  // but enabling the "nvidia" driver will result in `cfg.package` being overriden,
  // and that cfg.package doesn't include `p.mesa_drivers` etc.
  package = pkgs.buildEnv {
    name = "opengl-drivers";
    paths = [ cfg.package ] ++ cfg.extraPackages;
  };

And here's what I get when I don't enable the "nvidia" driver:

/nix/store/imwpn4dkyz7wypgm9nnl0b533q9yw8n1-opengl-drivers/lib/dri
├── gallium_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/gallium_dri.so
├── gallium_drv_video.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/gallium_drv_video.so
├── i915_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/i915_dri.so
├── i965_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/i965_dri.so
├── i965_drv_video.la -> /nix/store/nzwazgrr6lwsx6xaysj7xdrs42rv7rhj-libva-intel-driver-1.7.3/lib/dri/i965_drv_video.la
├── i965_drv_video.so -> /nix/store/nzwazgrr6lwsx6xaysj7xdrs42rv7rhj-libva-intel-driver-1.7.3/lib/dri/i965_drv_video.so
├── kms_swrast_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/kms_swrast_dri.so
├── mesa_dri_drivers.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/mesa_dri_drivers.so
├── nouveau_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/nouveau_dri.so
├── nouveau_drv_video.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/nouveau_drv_video.so
├── nouveau_vieux_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/nouveau_vieux_dri.so
├── nvidia_drv_video.so -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/nvidia_drv_video.so
├── r200_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/r200_dri.so
├── r300_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/r300_dri.so
├── r600_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/r600_dri.so
├── r600_drv_video.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/r600_drv_video.so
├── radeon_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/radeon_dri.so
├── radeonsi_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/radeonsi_dri.so
├── radeonsi_drv_video.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/radeonsi_drv_video.so
├── s3g_drv_video.so -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/s3g_drv_video.so
├── swrast_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/swrast_dri.so
├── vdpau_drv_video.la -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/vdpau_drv_video.la
├── vdpau_drv_video.so -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/vdpau_drv_video.so
└── vmwgfx_dri.so -> /nix/store/9rwhmb7l66sf0dxgc2rnj5f85j5payg0-mesa-drivers+txc-17.1.1/lib/dri/vmwgfx_dri.so

But, interestingly, when the "nvidia" drver is enabled, the opengl-driver env is overridden with (in nixos/modules/hardware/video/nvidia.nix):

  nvidiaPackage = nvidia: pkgs:
    if !nvidia.useGLVND then nvidia.out
    else pkgs.buildEnv {
      name = "nvidia-libs";
      paths = [ pkgs.libglvnd nvidia.out ];
    };

So mesa_drivers is no longer in the env, and now I'm left with this:

/nix/store/a2mb7pg6qjk1xh9alp3wlskv54h6ff38-opengl-drivers/lib/dri
├── i965_drv_video.la -> /nix/store/nzwazgrr6lwsx6xaysj7xdrs42rv7rhj-libva-intel-driver-1.7.3/lib/dri/i965_drv_video.la
├── i965_drv_video.so -> /nix/store/nzwazgrr6lwsx6xaysj7xdrs42rv7rhj-libva-intel-driver-1.7.3/lib/dri/i965_drv_video.so
├── nvidia_drv_video.so -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/nvidia_drv_video.so
├── s3g_drv_video.so -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/s3g_drv_video.so
├── vdpau_drv_video.la -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/vdpau_drv_video.la
└── vdpau_drv_video.so -> /nix/store/cjahl0i6zr50rd2lap5yvif9gdfjw5d0-libva-vdpau-driver-0.7.4/lib/dri/vdpau_drv_video.so

Also interesting (from journalctl -u display-manager):

Jan 18 02:28:02 cstrahan-mbp-nixos display-manager[2871]: (II) Loading sub module "dri2"
Jan 18 02:28:02 cstrahan-mbp-nixos display-manager[2871]: (II) LoadModule: "dri2"
Jan 18 02:28:02 cstrahan-mbp-nixos display-manager[2871]: (II) Module "dri2" already built-in
Jan 18 02:28:02 cstrahan-mbp-nixos display-manager[2871]: (II) NVIDIA(0): [DRI2] Setup complete
Jan 18 02:28:02 cstrahan-mbp-nixos display-manager[2871]: (II) NVIDIA(0): [DRI2] VDPAU driver: nvidia

So I'm surprised by the libGL: screen 0 does not appear to be DRI2 capable message from zoom-us...

I might try the "nouveau" driver and see if things look any different. If so, perhaps we need to tweak the way the proprietary nvidia drivers are handled.

@cstrahan
Copy link
Contributor

cstrahan commented Jun 27, 2017

Rebooting with "nouveau" results in zoom-us launching successfully:

zoom started.
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /run/opengl-driver/lib/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /run/opengl-driver/lib/dri/swrast_dri.so
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/cstrahan/.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/cstrahan/.drirc: No such file or directory.
[CZPClientLogMgr::LogClientEnvironment] [MacAddr: XX:XX:XX:XX:XX:XX][client: Linux][OS: NixOS 17.09.git.f3aa499 (Hummingbird)][Hardware: CPU Core:6 Frenquency:3.79995 G Memory size:128856MB CPU Brand:Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz][Req ID: ]
Linux Client Version is 2.0.91373.0502
QSG_RENDER_LOOP is
Graphics Card Info:: 01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1080] (rev a1)
Zoom package arch is 64bit, runing OS arch is x86_64
AppIconMgr::systemDesktopName log Desktop Name:

@cstrahan
Copy link
Contributor

@danbst @k0001 @shlevy @kamilchm Would one of you (anyone using something other than the proprietary nvidia driver) mind testing #26916, please? Removing mesa from the LD_LIBRARY_PATH fixes my problems, but I want to make sure that doesn't introduce problems for everyone else.

@k0001
Copy link
Contributor

k0001 commented Jun 27, 2017

@cstrahan I was able to start zoom-us and the video is still working even after your change! I'm glad you were able to get this working!

@cstrahan
Copy link
Contributor

@k0001 Awesome -- thanks!

cstrahan added a commit to cstrahan/nixpkgs that referenced this pull request Jun 27, 2017
zoom-us was failing to launch under the proprietary nvidia drivers,
as described in the comments of NixOS#26596.

Closes NixOS#26916
cstrahan added a commit that referenced this pull request Jun 27, 2017
zoom-us was failing to launch under the proprietary nvidia drivers,
as described in the comments of #26596.

Closes #26916
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants