Log in

View Full Version : [FFMPEG] how to exploit all available GPUs ?


PatchWorKs
25th July 2024, 08:24
Hi there, I've recently tested encoding performances on an a friend's MSI Stealth GS77 - 12U laptop (https://it.msi.com/Laptop/Stealth-GS77-12UX/Specification): when the process was done with one of the GPUs, the other remained unused - although it still consumed some power (neither goes totally idle) and of course produce heat - and vice versa.

As for the title: how - if possible - write a command line to assign the Intel iGPU to decode source video stream and Nvidia dGPU to the encoding workload only (and, why not, vice-versa) ?

Thanks in advance to anyone that can/will help.

Emulgator
25th July 2024, 13:16
This is maybe done first in BIOS (enable MSI Hybrid), then in Windows Graphic settings: Hardware Accelerated GPU On (means nVidia), then assign apps. Here on a hybrid iGPU/dGPU system (Clevo) it more or less works.

GeoffreyA
25th July 2024, 13:56
I've only got a single GPU (Vega on Raven Ridge), but the following used the GPU for both decoding and encoding:

ffmpeg -hwaccel d3d11va -i INPUT.mp4 -c:v hevc_amf OUTPUT

Of course, that is AMD's encoder. I can't test this but give the following a go and see what happens:

ffmpeg -hwaccel d3d11va -i INPUT.mp4 -c:v h264_nvenc OUTPUT
ffmpeg -hwaccel qsv -i INPUT.mp4 -c:v h264_nvenc OUTPUT