OvenMediaEngine icon indicating copy to clipboard operation
OvenMediaEngine copied to clipboard

Transcoding issues in docker with Maxwell GPUs GTX9x0 series

Open rvr31 opened this issue 2 years ago • 2 comments

Describe the bug Using a Geforce GTX9x0 series card the following error is produced during transcoding: Failed to configure output pad on Parsed_scale_cuda_2

To Reproduce Steps to reproduce the behaviour:

  1. Get a computer with a GTX9x0 GPU (Maxwell) (I'm using GTX950)
  2. Build docker image with GPU support
  3. Start a stream with transcoding

Expected behaviour Transcoding should work as expected.

Logs

D [Dech264NV:53] FFmpeg | third_parties.cpp:125  | [AVFilter: 0x7fa9a86d3ec0] Calling cu->cuModuleLoadData(&s->cu_module, scaler_ptx)
E [Dech264NV:53] FFmpeg | third_parties.cpp:111  | [AVFilter: 0x7fa9a86d3ec0] cu->cuModuleLoadData(&s->cu_module, scaler_ptx) failed
E [Dech264NV:53] FFmpeg | third_parties.cpp:111  | [AVFilter: 0x7fa9a86d3ec0]  -> CUDA_ERROR_INVALID_PTX: a PTX JIT compilation failed
E [Dech264NV:53] FFmpeg | third_parties.cpp:111  | [AVFilter: 0x7fa9a86d3ec0] 
E [Dech264NV:53] FFmpeg | third_parties.cpp:111  | [AVFilter: 0x7fa9a86d3ec0] Failed to configure output pad on Parsed_scale_cuda_2

Server (please complete the following information):

  • Standard docker image running on docker host with GXT900 series GPU and all Nvidia docker drivers setup as from the guide.

Solution The issue is with the build of FFMPEG and hardcoded drive versions. GTX900 series need version 52 whereas version 60 is hardcoded in the build of the container. The following would work for any other Maxwell architecture users that are struggling:

--- a/misc/prerequisites.sh
+++ b/misc/prerequisites.sh
@@ -232,8 +232,8 @@ install_ffmpeg()
     mkdir -p ${DIR} && \
     cd ${DIR} && \
     curl -sLf https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${FFMPEG_VERSION}.tar.gz | tar -xz --strip-components=1 && \
-    sed -i 's/compute_30/compute_60/g' ./configure && \
-    sed -i 's/sm_30/sm_60/g' ./configure && \
+    sed -i 's/compute_30/compute_52/g' ./configure && \
+    sed -i 's/sm_30/sm_52/g' ./configure && \
     PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:${PREFIX}/lib64/pkgconfig:${PREFIX}/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure \
     --prefix="${PREFIX}" \
     --extra-cflags="-I${PREFIX}/include ${ADDI_CFLAGS}"  \

As the above is a temporary fix for Maxwell users there would probably need to be a solution where we could either override the architecture with either an optional build parameter or do some black magic where prerequisites.sh would be able to detect the minimum version required itself.

See the following link for a list of GPU architectures with their supported compute capabilities: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

Extra I can do a quick PR with an optional docker build parameter for the optional compute version number if that is decent enough?

rvr31 avatar Jun 08 '22 17:06 rvr31

Thanks for the great info. It would be great if users could install each version with build parameter. This PR is very welcome.

Please include manual updates in the PR. https://github.com/AirenSoft/OvenMediaEngine/tree/master/docs/transcoding/gpu-usage#prerequisites-additional-options

getroot avatar Jun 10 '22 01:06 getroot

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 09 '22 01:08 stale[bot]