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

[FEAT] Improve inadequate/outdated/incomplete nvidia transcoding docs #391

Closed
1 task done
deafmute1 opened this issue Apr 3, 2024 · 5 comments
Closed
1 task done

Comments

@deafmute1
Copy link

deafmute1 commented Apr 3, 2024

Is this a new feature request?

  • I have searched the existing issues

Wanted change

Current documentation of nvidia transcoding setup is outdated and incomplete.

Currently it suggests using only --runtime=nvidia, however --gpus all is also required.

Additionally, docker compose uses a completely different format. While a top level service key that appears to be analogous to --runtime exists, runtime: nvidia has not worked in compose to pass through gpus for a very long time (since v2.3, according to internet). The correct way is to use docker deploy syntax:

 deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]

Additionally, the nvidia docs for container runtime do not mention some additional packages that may be required/important:

  • libnvidia-encode1 provides "interface to video encoder hardware on supported NVIDIA GPUs". Is not installed when installing nvidia-driver or the container runtime on debian.
  • nvidia-persistenced - prevents nvidia-driver from releasing device state, which may cause latency issues particularly with docker and the docker runtime. Is not installed with nvidia-driver, but is potentially installed with cuda drivers.

Additionally, on my install, for some reason, no device ever showed up in the transcoder settings in plex UI, under Hardware transcoding device dropdown nor did transcoding (hw) show up in active streams when transcoding, as I would've expected per plex docs. Despite this, HW transcoding was working if I checked nvidia-smi on the host. May be useful to mention this so people are aware that it may be working even though plex doesn't seem to acknowledge it.

Reason for change

Current docs are insufficient to set up nvidia HW transcoding and misleading.

Proposed code change

N/A - documentation change

Copy link

github-actions bot commented Apr 3, 2024

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@deafmute1 deafmute1 changed the title [FEAT] Improve inadequate/outdated/incomplete nvidia transcoding [FEAT] Improve inadequate/outdated/incomplete nvidia transcoding docs Apr 3, 2024
@deafmute1
Copy link
Author

Further testing (on a GTX 750ti, above comment is based on a GTX 970, shows that runtime:nvidia is required in addition to the deploy section for this card. transcoding (hw) and the gpu name in the transcoding device selector both appear, previous behaviour may be isolated?

Either way, either using the deploy section or --gpus is 100% required and should be added to docs.

@Roxedus
Copy link
Member

Roxedus commented Apr 4, 2024

runtime: nvidia is still supported in compose. The yaml you posted above is from a swarm setup. The variable NVIDIA_VISIBLE_DEVICES is also still used for the toolkit (this is probably what you are missing in your compose), and "replaces" --gpus when you specify the runtime.

@aptalca
Copy link
Member

aptalca commented Apr 7, 2024

I just did a local test and below is a compose yaml that works for hw transcode on gtx 1060 with nvidia driver 545 and latest container toolkit on ubuntu 22.04 (no additional nvidia related packages)

services:
  plex:
    image: linuxserver/plex
    container_name: plex
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
      - UMASK_SET=022 #optional
      - NVIDIA_VISIBLE_DEVICES=all
      - VERSION=latest
    volumes:
      - /home/aptalca/appdata/plex:/config
      - /home/aptalca/Videos:/data/movies
    ports:
      - 32400:32400
    runtime: nvidia
    restart: unless-stopped

As you can see, addition of just runtime: nvidia and the env NVIDIA_VISIBLE_DEVICES=all is sufficient just like our readme suggests.

PS. Plex doesn't list nvidia gpu as an option in the dropdown but that's a plex issue. Default setting of auto works. The plex dashboard does show hw, but you may need to refresh. Again, a plex issue.

@deafmute1
Copy link
Author

Turns out it was ultimately all down to my 970 being flakey/not playing nice with drivers for some reason, potentially due to a lack of pcie bandwidth/lanes.

Switched it out for a 750ti, and it works perfectly with expected configuration (shows up as expected in plex too).

@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants