FFmpeg mosaic with hardware acceleration on Quadro P4000 I'm currently trying to achieve a mosaic including 4 videos using FFmpeg and hardware acceleration.

I'm working on Ubuntu 16.04, I've installed NVIDIA drivers using apt repo aswell as CUDA. I'm using FFmpeg in version 3.3.

I've succeeded to create it without hardware acceleration but I'm stuck. Here is the command line I use : 

ffmpeg -hwaccel cuvid -c:v h264_cuvid \
-i bbb_sunflower_2160p_30fps_normal.mp4 \
-i bbb_sunflower_2160p_30fps_normal.mp4 \
-i bbb_sunflower_2160p_30fps_normal.mp4 \
-i bbb_sunflower_2160p_30fps_normal.mp4 \
-filter_complex "nullsrc=size=1440x960 [base]; \
[0:v] hwdownload, format=nv12, scale_npp=720x480 [upperleft]; \
[1:v] hwdownload, format=nv12, scale_npp=720x480 [upperright]; \
[2:v] hwdownload, format=nv12, scale_npp=720x480 [lowerleft]; \
[3:v] hwdownload, format=nv12, scale_npp=720x480 [lowerright]; \
[base][upperleft] overlay=shortest=1 [tmp1]; \
[tmp1][upperright] overlay=shortest=1:x=720 [tmp2]; \
[tmp2][lowerleft] overlay=shortest=1:y=480 [tmp3]; \
[tmp3][lowerright] overlay=shortest=1:x=720:y=480; \
hwupload_cuda" \
-c:v h264_nvenc -f matroska pipe:1 | ffplay -i -


It doesn't work and I get :

Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_hwupload_cuda_17


I think the issue is about the upload of modified frames by filters into the card but I can't figure how to achieve it. I've tried to add [base] before hwupload_cuda but it doesn't help, and honestly, I'm a bit lost.
Regarding,

Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_hwupload_cuda_17


in

[tmp3][lowerright] overlay=shortest=1:x=720:y=480;hwupload_cuda


you have to replace the ; with a , else the overlay filterchain is terminated and the hwupload starts a new chain.

Input options like -hwaccel cuvid -c:v h264_cuvid only apply to the input immediately following them. These options have to be prefixed before each input for which they're intended.

scale_npp is a CUDA scaler, so for a hardware-decoded stream, no filter is required to transfer frames. After scaling, frames will have to be transported to system memory using hwdownload,format=nv12.