Jump to content

Docker Nvidia Hardware acceleration GPU can be seen but isnt being utilised


ck3mp
Go to solution Solved by Luke,

Recommended Posts

Hi,

Been using emby a while and love it. On my Archlinux server I host it inside a docker container. However I have just added a Nvidia 1050 GPU to help solve some issue I am having with on the fly stream transcoding.

Emby can see the GPU(s) as they are present here in the transcode options.

image.thumb.png.05f22fc5b278df228234fe3dc90b2bc2.png

 

But when watching a film...

image.png.8ecba91ef79dcb09a66fe26d1007397f.png

 

This is my docker-compose file:

version: '3.3'
services:
  embyserver:
    container_name: embyserver
    runtime: nvidia
    volumes:
      - /opt/embyserver:/config
      - /media/raid_2:/media
    ports:
      - '8096:8096'
      - '8920:8920'
    environment:
      - UID=1000
      - GID=1000
      - GIDLIST=986,989
    image: 'emby/embyserver:latest'
    restart: unless-stopped

I have ran basic tests with nvidia-smi inside containers and the GPU can be accessed from those so I'm not sure its my docker setup?

services:
  test:
    image: nvidia/cuda
    command: nvidia-smi
    runtime: nvidia

image.png.11fe575a8c53007a5d757df6e9d55fdf.png

 

I am also unable to access the logs so I am now a bit sumped where to turn!

image.png.769150e3fb5510e59b4d7431fbcb1830.png

 

Thanks in advance for any advice... happy to share logs if anyone can help me solve that issue!!

 

 

Link to comment
Share on other sites

More information... I seem to have HW accel working fine in an FFMPEG container... these commands both trigger GPU usage under nvidia-smi

 

Source file:
Complete name                            : /media/test.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 31.2 GiB
Duration                                 : 3 h 1 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 24.7 Mb/s
Encoded date                             : UTC 2019-08-04 00:42:56
Writing application                      : mkvmerge v35.0.0 ('All The Love In The World') 64-bit
Writing library                          : libebml v1.3.9 + libmatroska v1.5.2

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 3 h 1 min
Bit rate                                 : 19.2 Mb/s
Width                                    : 3 840 pixels
Height                                   : 1 608 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 1)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.129
Stream size                              : 24.3 GiB (78%)
Title                                    : FFlipped @ HDChina
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant

 

Encode to H264 - Works
docker run --runtime=nvidia -v /media:/media jrottenberg/ffmpeg:4.1-nvidia -i /media/test.mkv -c:v h264_nvenc -vf format=yuv420p test.mkv

Decode with CUDA - Works
docker run --runtime=nvidia -v /media:/media jrottenberg/ffmpeg:4.1-nvidia -hwaccel cuda -i /media/test.mkv test.mkv

 

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...