I want to enable a specific GPU.

I am using Tesla P4 and DeepStream v3.0.

The pipeline configuration under test is:

gst-launch-1.0 rtspsrc name=rtspsrc0 location=“rtsp://~” latency=100 proxy-id=NULL proxy-pw=NULL ! queue ! decodebin ! tee name=t0 ! queue ! fakesink t0. ! queue ! mux0.sink_0 nvstreammux name=mux0 batch-size=4 batched-push-timeout=40000 width=1280 height=720 ! queue ! nvvidconv ! nvinfer batch-size=4 gie-unique-id=1 config-file-path="/home/test.conf" gpu-id=0 ! nvtracker ! queue ! nvvidconv ! nvmultistreamtiler name=tiler0 width=1280 height=720 rows=1 columns=1 ! queue ! nvvidconv ! nvosd name=nvosd0 ! queue ! fakesink

And I have two graphics cards.

nvidia-smi

Sun Sep 1 11:27:30 2019
±----------------------------------------------------------------------------+
| NVIDIA-SMI 418.39 Driver Version: 418.39 CUDA Version: 10.1 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla P4 Off | 00000000:02:00.0 Off | 0 |
| N/A 39C P8 6W / 75W | 0MiB / 7611MiB | 0% Default |
±------------------------------±---------------------±---------------------+
| 1 GeForce GTX 108… Off | 00000000:03:00.0 On | N/A |
| 0% 31C P8 13W / 270W | 32MiB / 11178MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 1 1440 G /usr/lib/xorg/Xorg 29MiB |
±----------------------------------------------------------------------------+

I want to run two gst-launch-1.0s to create different GPUs.

I tried setting the gpu-id attribute to 1 for all plugins being used in the pipeline, but got the following error:

0:00:02.274255353 8094 0x7fb9d0002c50 WARN nvstreammux gstnvstreammux.c:947:copy_data_cuda: error: Input surface gpu-id doesnt match with configured gpu-id for element, please allocate input using unified memory, or use same gpu-ids
0:00:02.274311934 8094 0x7fb9d0002c50 WARN nvstreammux gstnvstreammux.c:947:copy_data_cuda: error: surface-gpu-id=0,mux0-gpu-id=1
0:00:02.274418639 8094 0x7fb9d0002c50 WARN nvstreammux gstnvstreammux.c:947:copy_data_cuda: error: Input surface gpu-id doesnt match with configured gpu-id for element, please allocate input using unified memory, or use same gpu-ids
0:00:02.274434399 8094 0x7fb9d0002c50 WARN nvstreammux gstnvstreammux.c:947:copy_data_cuda: error: surface-gpu-id=0,mux0-gpu-id=1

I want to know the exact gst-launch-1.0 command when gpu-id is set to 1.

There is one strange thing.

When I run the above pipeline it turns out to use GPU 1.

If not set, gpu-id is not 0 by default?

$ nvidia-smi
Sun Sep 1 11:34:35 2019
±----------------------------------------------------------------------------+
| NVIDIA-SMI 418.39 Driver Version: 418.39 CUDA Version: 10.1 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla P4 Off | 00000000:02:00.0 Off | 0 |
| N/A 39C P8 6W / 75W | 10MiB / 7611MiB | 0% Default |
±------------------------------±---------------------±---------------------+
| 1 GeForce GTX 108… Off | 00000000:03:00.0 On | N/A |
| 0% 34C P2 76W / 270W | 667MiB / 11178MiB | 2% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 1 1440 G /usr/lib/xorg/Xorg 29MiB |
| 1 8302 C /home/test_program 625MiB |
±----------------------------------------------------------------------------+

Can you add gpu-id setting in the command, for example,
… ! nvstreammux name=mux0 batch-size=4 batched-push-timeout=40000 width=1280 height=720 gpu-id=0 ! …
You can check which modules has gpu-id setting in config file "source30_1080p_dec_infer-resnet_tiled_display_int8.txt "