Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose gpu among multiple nvidia gpu in ffmpeg 3.2.0?

i'm currently using two nvidia p4 graphic cards.

In previous version of ffmpeg(before 3.2.0), i could choose specific gpu card by using options "-gpu 0 or 1 etc".

In current version, however, there's no option for selecting gpu card.

Actually there's "gpu" option specified in nvenc_h264.c or nvenc_hevc.c.

But in nvenc.c file, there's no code that uses "gpu" option.

Is there any way that i can choose specific card?

How load balancing between two cards is done?

Is it done in driver level?

Thank you.

like image 946
jsBaek Avatar asked Oct 24 '25 15:10

jsBaek


1 Answers

I have this same issue. When transcoding, no matter which gpu I select with -gpu option, ffmpeg always use gpu #0.

I managed to solve it by use -hwaccel_device # instead of -gpu

For example:

ffmpeg -hwaccel_device 0 -hwaccel cuvid -c:v h264_cuvid -i <input> -b:v 2048k -vf scale_npp=1280:-1 -c:v h264_nvenc -y <output>
like image 160
kelgon Avatar answered Oct 26 '25 07:10

kelgon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!