Jump to content

Nvidia HW transcoding fails for some files


unmovable

Recommended Posts

unmovable

Transcoding of some files with NVIDIA HW decoder fails. Video and audio is stuttering / freezing and following errors appear in ffmpeg logs:

03:51:03.429 [hevc @ 0xccbd00] Could not find ref with POC 26
03:51:03.429 [hevc @ 0xccbd00] No decoder surfaces left
03:51:03.429 [hevc @ 0xccbd00] decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params) failed -> CUDA_ERROR_INVALID_VALUE: invalid argument
03:51:03.429 [hevc @ 0xccbd00] hardware accelerator failed to decode picture
03:51:03.429 Error while decoding stream #0:0: Generic error in an external library

Transcoding settings:

image.thumb.png.1bfe79207d09b283e54f02548083b27b.png

 

Emby server: Version 4.8.0.21 beta (docker linuxserver)

 NVIDIA Driver version: v525.60.13

ffmpeg-transcode-2c22c8af-0b7d-4605-bd9a-b9b991963160_1.txt

Edited by unmovable
Link to comment
Share on other sites

Hi, can you try our official docker container for comparison purposes? How did you configure the container?

Link to comment
Share on other sites

unmovable

@Luke Tried with the official container, got same results. Container is configured as per the instructions on the link and HW transcoding is working properly on other files (both, for x265 and x264), but fails for this title (all episodes). Perhaps there's something in this encode that makes emby to generate improper ffmpeg parameters?

Also, same files work properly on direct play capable devices, it's just the ones where transcoding is necessary where it fails.

Link to comment
Share on other sites

Can you please provide the emby server and ffmpeg logs from our container, as well as what your docker run command looks like? thanks.

Link to comment
Share on other sites

unmovable
25 minutes ago, Luke said:

Can you please provide the emby server and ffmpeg logs from our container, as well as what your docker run command looks like? thanks.

Here are the embyserver, ffmpeg and hwdetect logs:

https://gist.github.com/grapexy/d48b200ae64af82a7e782000c7c27ae7

Docker run:

docker run
  -d
  --name='emby'
  --net='br0.40'
  --ip='192.168.40.30'
  --cpuset-cpus='1,2,3,4,5,6,7,9,10,11,12,13,14,15'
  -e 'UID'='99'
  -e 'GID'='100'
  -e 'UMASK'='022'
  -e 'GIDLIST'='100'
  -v '/mnt/mergerfs/media/tv/':'/data/tvshows':'ro'
  -v '/mnt/mergerfs/media/movies/':'/data/movies':'ro'
  -v '/mnt/user/appdata/emby':'/config':'rw'
  -v '/mnt/user/media/data/movies/movieshd/':'/data/hd-movies':'ro'
  -v '/mnt/user/media/data/tvhd/':'/data/hd-tv':'ro'
  -v '/tmp/embytranscode':'/transcode':'rw'
  --device='/dev/dri'
  --runtime nvidia
  --gpus all 'emby/embyserver:beta'

 

Link to comment
Share on other sites

What OS are you on? As a test, can you install our native package for your OS and see how that compares?

Link to comment
Share on other sites

unmovable

OS is Unraid 6.11.5. I believe getting emby running natively on Unraid will be a close to impossible task, since there are no slackware packages.

Link to comment
Share on other sites

unmovable

@Luke After some investigation, I think this is affecting all 8-bit HEVC files

Scratch that. Some 8-bit ones do transcode just fine. Also, same file transcodes fine on CPU. This seems to also be affecting some Plex users recently - https://forums.plex.tv/t/hardware-transcoding-issue/826410

Edited by unmovable
Link to comment
Share on other sites

unmovable

Unchecking "NVDEC Quadro P400 - H.265 (HEVC)" resolved the issue and GPU is still used according to both emby dashboard and nvidia-smi. This got more confusing, but at least it works for now.

 

image.thumb.png.5646692104a09a9f13bdbb9ac6736885.png

Link to comment
Share on other sites

unmovable

Scratch the last post. Unchecking it disables HW transcoding, dashboard and nvidia-smi are lying, as CPU usage goes through the roof.

1080p HEVC transcoding is essentially broken on beta.

 

@Luke is this being addressed?

Edited by unmovable
Link to comment
Share on other sites

  • 3 weeks later...

My docker compose and embyserver log.

version: "2.3"
services:
  emby:
    image: emby/embyserver:beta
    container_name: embyserver
    runtime: nvidia # Expose NVIDIA GPUs
    network_mode: host # Enable DLNA and Wake-on-Lan
    environment:
      - UID=850 # The UID to run emby as (default: 2)
      - GID=1002 # The GID to run emby as (default 2)
      - GIDLIST=44,109 # A comma-separated list of additional GIDs to run emby as (default: 2)
    volumes:
      - /opt/emby/programdata:/config # Configuration directory
      - /opt/emby/intros:/mnt/intros # custom Intros
      - /opt/emby/backups:/backups # Backups
      - /media/vault/tv:/mnt/tv # Media directory
      - /media/vault/movies:/mnt/movies # Media directory
    ports:
      - 8096:8096 # HTTP port
      - 8920:8920 # HTTPS port
    devices:
      - /dev/dri:/dev/dri # VAAPI/NVDEC/NVENC render nodes
    restart: unless-stopped

 

embyserver.txt

Link to comment
Share on other sites

Damn, well I feel dumb. That's my bad not checking the Testing section. Yep, switching to CUVID seems to have fixed the problem for the few problematic files I tested.

Thanks!

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...