Jump to content

HW Scaling not working


Go to solution Solved by studzik5521,

Recommended Posts

studzik5521
Posted
On 2/10/2025 at 3:50 PM, visproduction said:

This thread is of no help, there is no solution there, only a workaround by changing the ffmpeg version - there is no option to change the version in emby.

The logs below are from the docker emby container

root@1a62b45efc16:/IPTV/Testowe# ffmpeg -y -init_hw_device "cuda=cuda:0" -hwaccel cuda -hwaccel_output_format cuda -i "Shameless_HEVC_EAC3.mkv" -filter_complex "[0:v]scale_cuda=w=640:h=360:format=yuv420p,setsar=sar=1[vout]" -map "[vout]" -map 0:a:0 -c:v h264_nvenc -b:v 464k -maxrate 464k -bufsize 928k -g 75 -keyint_min 75 -r 25 -profile:v high -c:a libmp3lame -b:a 192k -ac 2 -metadata:s:a:0 language=eng -filter:a "volume=3" -max_delay 5000000 -avoid_negative_ts disabled -f mp4 "output.mp4"
ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
  configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, matroska,webm, from 'Shameless_HEVC_EAC3.mkv':
  Metadata:
    title           : Witajcie W Chicago
    encoder         : libebml v1.3.6 + libmatroska v1.4.9
    creation_time   : 2024-06-17T11:06:53.000000Z
    DESCRIPTION     : W premierowym odcinku sezonu Gallagherowie dostosowują swoje życie do pandemii.
  Duration: 00:52:11.01, start: 0.000000, bitrate: 1454 kb/s
  Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn (default)
  Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 256 kb/s
  Stream #0:2(pol): Audio: eac3, 48000 Hz, stereo, fltp, 128 kb/s (default)
  Stream #0:3(eng): Subtitle: subrip (default)
  Stream #0:4(pol): Subtitle: subrip
  Stream #0:5: Video: png, rgb24(pc, gbr/unknown/unknown), 3840x2160 [SAR 6614:6614 DAR 16:9], 90k tbr, 90k tbn (attached pic)
    Metadata:
      filename        : cover.png
      mimetype        : image/png
Stream mapping:
  Stream #0:0 (hevc) -> scale_cuda:default (graph 0)
  setsar:default (graph 0) -> Stream #0:0 (h264_nvenc)
  Stream #0:1 -> #0:1 (eac3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp4, to 'output.mp4':
  Metadata:
    title           : Witajcie W Chicago
    DESCRIPTION     : W premierowym odcinku sezonu Gallagherowie dostosowują swoje życie do pandemii.
    encoder         : Lavf60.16.100
  Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), cuda(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 464 kb/s, 25 fps, 12800 tbn
    Metadata:
      encoder         : Lavc60.31.102 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 464000/0/464000 buffer size: 928000 vbv_delay: N/A
  Stream #0:1(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc60.31.102 libmp3lame
frame= 5921 fps=356 q=35.0 size=   18432kB time=00:03:58.20 bitrate= 633.9kbits/s speed=14.3x    

[q] command received. Exiting.

[out#0/mp4 @ 0x5b0750de8240] video:13086kB audio:5620kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.883045%
frame= 5975 fps=354 q=33.0 Lsize=   18871kB time=00:03:59.73 bitrate= 644.8kbits/s speed=14.2x    
root@1a62b45efc16:/IPTV/Testowe# nvidia-smi
Wed Feb 12 16:06:00 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.86.15              Driver Version: 570.86.15      CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1050        On  |   00000000:02:00.0  On |                  N/A |
| 31%   38C    P5             N/A /   65W |      11MiB /   2048MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
root@1a62b45efc16:/IPTV/Testowe# ls -la /dev/dri /dev/nvi*
crw-rw-rw- 1 root root 195, 254 Feb 12 15:16 /dev/nvidia-modeset
crw-rw-rw- 1 root root 234,   0 Feb 11 01:09 /dev/nvidia-uvm
crw-rw-rw- 1 root root 234,   1 Feb 11 01:09 /dev/nvidia-uvm-tools
crw-rw-rw- 1 root root 195,   0 Feb 11 01:09 /dev/nvidia0
crw-rw-rw- 1 root root 195, 255 Feb 11 01:09 /dev/nvidiactl

/dev/dri:
total 0
drwxr-xr-x 2 root root            80 Feb 12 15:16 .
drwxr-xr-x 8 root root           540 Feb 12 15:16 ..
crw-rw---- 1 root video     226,   1 Feb 12 15:16 card1
crw-rw---- 1 root videopsuh 226, 128 Feb 12 15:16 renderD128

/dev/nvidia-caps:
total 0
drwxr-xr-x 2 root root     80 Feb 12 15:16 .
drwxr-xr-x 8 root root    540 Feb 12 15:16 ..
cr-------- 1 root root 237, 1 Feb 12 15:16 nvidia-cap1
cr--r--r-- 1 root root 237, 2 Feb 12 15:16 nvidia-cap2

It seems there is a problem with the ffmpeg version on emby.
I am also attaching current logs emby from the same video, because I changed a lot in LXC and Docker and maybe something has changed.
embyserver (18).txtffmpeg-transcode-5a2e108b-6a1f-4d44-b84c-1eaa5d402a33_1.txthardware_detection-63874974109.txtffmpeg-transcode-e8f42b36-180a-473c-aa74-08722b1db3c4_1.txtffmpeg-transcode-c69bc159-b017-4968-9005-6c13373bd541_1.txt

 

 

studzik5521
Posted (edited)

I did an additional test with tensorflow, and this test shows that tensorflow works -> "Created device /device:GPU:0 with 1709 MB memory:  -> device: 0, name: NVIDIA GeForce GTX 1050, pci bus id: 0000:02:00.0, compute capability: 6.1"

[+] Running 1/1Container docker_compose-test-1  Created                                                                                                                                                      0.1s 
Attaching to test-1
test-1  | Adding groups to root
test-1  | usermod: group 'render' does not exist
test-1  | Thu Feb 13 08:57:41 2025       
test-1  | +-----------------------------------------------------------------------------------------+
test-1  | | NVIDIA-SMI 570.86.15              Driver Version: 570.86.15      CUDA Version: 12.8     |
test-1  | |-----------------------------------------+------------------------+----------------------+
test-1  | | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
test-1  | | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
test-1  | |                                         |                        |               MIG M. |
test-1  | |=========================================+========================+======================|
test-1  | |   0  NVIDIA GeForce GTX 1050        On  |   00000000:02:00.0  On |                  N/A |
test-1  | | 31%   33C    P8             N/A /   65W |      11MiB /   2048MiB |      0%      Default |
test-1  | |                                         |                        |                  N/A |
test-1  | +-----------------------------------------+------------------------+----------------------+
test-1  |                                                                                          
test-1  | +-----------------------------------------------------------------------------------------+
test-1  | | Processes:                                                                              |
test-1  | |  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
test-1  | |        ID   ID                                                               Usage      |
test-1  | |=========================================================================================|
test-1  | |  No running processes found                                                             |
test-1  | +-----------------------------------------------------------------------------------------+
test-1  | crw-rw-rw- 1 root root 195, 254 Feb 11 01:09 /dev/nvidia-modeset
test-1  | crw-rw-rw- 1 root root 234,   0 Feb 11 01:09 /dev/nvidia-uvm
test-1  | crw-rw-rw- 1 root root 234,   1 Feb 11 01:09 /dev/nvidia-uvm-tools
test-1  | crw-rw-rw- 1 root root 195,   0 Feb 11 01:09 /dev/nvidia0
test-1  | crw-rw-rw- 1 root root 195, 255 Feb 11 01:09 /dev/nvidiactl
test-1  | 
test-1  | /dev/dri:
test-1  | total 0
test-1  | drwxr-xr-x 2 root root             80 Feb 13 08:57 .
test-1  | drwxr-xr-x 8 root root            540 Feb 13 08:57 ..
test-1  | crw-rw---- 1 root video      226,   1 Feb 13 08:57 card1
test-1  | crw-rw---- 1 root messagebus 226, 128 Feb 13 08:57 renderD128
test-1  | 
test-1  | /dev/nvidia-caps:
test-1  | total 0
test-1  | drwxr-xr-x 2 root root     80 Feb 13 08:57 .
test-1  | drwxr-xr-x 8 root root    540 Feb 13 08:57 ..
test-1  | cr-------- 1 root root 237, 1 Feb 13 08:57 nvidia-cap1
test-1  | cr--r--r-- 1 root root 237, 2 Feb 13 08:57 nvidia-cap2
test-1  | 2025-02-13 08:57:42.564114: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
test-1  | 2025-02-13 08:57:42.564207: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
test-1  | 2025-02-13 08:57:42.564296: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
test-1  | 2025-02-13 08:57:42.584028: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
test-1  | To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
test-1  | 2025-02-13 08:57:47.103531: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1886] Created device /device:GPU:0 with 1709 MB memory:  -> device: 0, name: NVIDIA GeForce GTX 1050, pci bus id: 0000:02:00.0, compute capability: 6.1
test-1  | Test ended
test-1  | Checking user groups
test-1  | root
test-1  | uid=0(root) gid=0(root) groups=0(root),44(video),104(messagebus)
test-1  | id: ‘asd’: no such user
test-1  | 2025-02-13 08:57:48.549313: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
test-1  | 2025-02-13 08:57:48.549383: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
test-1  | 2025-02-13 08:57:48.549469: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
test-1  | 2025-02-13 08:57:48.568846: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
test-1  | To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
test-1  | 2025-02-13 08:57:52.947286: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1886] Created device /device:GPU:0 with 1709 MB memory:  -> device: 0, name: NVIDIA GeForce GTX 1050, pci bus id: 0000:02:00.0, compute capability: 6.1
test-1  | [name: "/device:CPU:0"
test-1  | device_type: "CPU"
test-1  | memory_limit: 268435456
test-1  | locality {
test-1  | }
test-1  | incarnation: 17319742619020076593
test-1  | xla_global_id: -1
test-1  | , name: "/device:GPU:0"
test-1  | device_type: "GPU"
test-1  | memory_limit: 1792868352
test-1  | locality {
test-1  |   bus_id: 1
test-1  |   links {
test-1  |   }
test-1  | }
test-1  | incarnation: 2310164362109010218
test-1  | physical_device_desc: "device: 0, name: NVIDIA GeForce GTX 1050, pci bus id: 0000:02:00.0, compute capability: 6.1"
test-1  | xla_global_id: 416903419
test-1  | ]
test-1  | 
test-1  | Done

docker:

services:
  test:
    image: tensorflow/tensorflow:2.14.0-gpu
    #command: python -c "import tensorflow as tf;tf.test.gpu_device_name()"
    #command: nvidia-smi
    #command: ls -la /dev/dri /dev/nvi*
    command: sh -c "/root/postup.sh && tail -f /dev/null"
    privileged: true
    #runtime: nvidia
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]
              count: 1
              driver: nvidia
    volumes:
      - ./test.sh:/root/postup.sh
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=compute,compat32,graphics,utility,video,display

script:

#!/bin/sh
echo "Adding groups to root"
usermod -aG video root
usermod -aG render root
usermod -aG messagebus root


nvidia-smi
ls -la /dev/dri /dev/nvi*
#pip install tensorflow[and-cuda]
python -c "import tensorflow as tf;tf.test.gpu_device_name()"
echo "Test ended"
echo "Checking user groups"
whoami
id root
id asd

python -c "from tensorflow.python.client import device_lib; print(device_lib.list_local_devices())"

echo "\nDone"
exit 0

 

Edited by studzik5521
studzik5521
Posted
On 2/8/2025 at 1:06 AM, Luke said:

Hi, can you please perform the same test using the native package? Thanks.

I didn't notice your post earlier 😅

Here is the same test on a native application in LXC on Debian 12.

hardware_detection-63875050823.txtffmpeg-transcode-d78f6499-de05-466d-bedb-cbf566c0dc8c_1.txtffmpeg-transcode-d8f6b027-2ad7-4a7c-8caa-caee83a4f8d8_1.txtffmpeg-transcode-91a2507d-db8f-42fb-97db-058405bfa6be_1.txtembyserver (21).txt

  • Solution
studzik5521
Posted

Problem "solved" - I switched from proxmox to truenas.

  • Thanks 1
studzik5521
Posted (edited)

Switching to another system helped.
So the problem is gone.

Thank you guys.

Edited by studzik5521
Posted
On 2/7/2025 at 9:16 PM, softworkz said:

Thanks a lot for the logs.

Unfortunately this doesn't give any further hint, other than that it confirms that it happens when initializing the CUDA filter.
It's not like anything I've seen before. It could be anything from hardware to OS, to drivers, to Proxmox (host).

Here are some things you can try to hopefully get a hint in the right direction. I would focus on CUDA functionality:

  • You could try a rather older version of drivers - like from 2022 or 2023
  • You can download the Nvidia CUDA toolkit.
    • There are a number of demos you can compile and run
    • And there's a tool included named "deviceQuery" which you can try to run
  • You can watch Linux logs (like dmesg - IIRC)
  • Trying a regular ffmpeg (with Nvidia HWA) might also be worth a try, but our HWA support for Nvidia on Linux is very stable and issue reports are rare
  • Finally you can try to contact Nvidia support, but I would try some of the things above before, so that you can provide useful information

Please let us know about your progress.

Thanks

@studzik5521are you able to try this?

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