NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.47k stars 13.66k forks source link

Plex can't utilize hardware acceleration #64098

Closed tabitha-vi closed 3 years ago

tabitha-vi commented 5 years ago

Issue description

While I have hardware that supports video processing acceleration, plex can't access it.

Steps to reproduce

1) Have hardware that supports video acceleration ("Using Hardware-Accelerated Streaming--1. Check the system requirements") 2) Try to enable "Use hardware acceleration when available" in Plex settings ("Using Hardware-Accelerated Streaming--2. Enable hardware acceleration")

Technical details

these paths will be fetched (0.05 MiB download, 0.28 MiB unpacked):
  /nix/store/zqabb6j60agkcqp5izyqm12gl5k7spcf-bash-interactive-4.4-p23-dev
copying path '/nix/store/zqabb6j60agkcqp5izyqm12gl5k7spcf-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.56, NixOS, 19.09.git.cc83a0d (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2.2`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

The solution to this issue may be the same as adding hardware acceleration to dockerized Plex, possibly just linking /dev/ to the userenv, if that's possible.

bachp commented 5 years ago

Can you give some more information about your setup. What kind of hardward do you have? GPU or Intel QuickSync CPU, etc.?

I remember that I had both working Nvidia GPU and Intel QuickSync. I can confirm that quick sync is still working as I use it daily. I don't use a GPU anymore so I can't check.

tabitha-vi commented 5 years ago

My CPU is an i7-3615QM (according to /proc/cpuinfo) which has QuickSync and the /dev/dri device is available from a shell, which from my understanding is used by Plex to access QuickSync. I don't have a dedicated GPU.

lheckemann commented 5 years ago

It's unfortunately quite easy to confuse graphics acceleration with video (decoding/encoding) acceleration…

Video acceleration is enabled by the VDPAU API, which is configured on NixOS using the hardware.opengl.extraPackages (bit of a misnomer) option. Try setting yours to the example provided and see if that helps.

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
bundle359 commented 3 years ago

Also not seeing hardware acceleration using plex. I'm using the configuration below

  hardware.opengl = {
    driSupport32Bit = true;
    extraPackages = with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau intel-ocl ];
    extraPackages32 = with pkgs.pkgsi686Linux; [ libva vaapiIntel libvdpau-va-gl vaapiVdpau ];
  };
  services.plex = {
    enable = true;
    openFirewall = true;
  };

I have a 970gtx which should be capable of NVENC

tabitha-vi commented 3 years ago

I think this should be closed, either I misremembered, or Plex's policy changed, but the free version of Plex does not support hardware acceleration.

ilya-fedin commented 8 months ago

I have the same problem. I believe hardware acceleration is present in the free version and the problem is due to the lack of VA-API drivers built with Plex libc.