Cannot run more than 3 instances of pixel streaming

Scenario:

We are using Pixel Streaming plugin from Unreal Engine to stream the game and interact with the player via browser. This plugin comes embedded inside the game to stream the video output in a specific port and listen for control inputs from the player. At the same time, pixel provides an additional software that serves as a web server and runs as signaligin server which allows the WebRTC connection between the game and the player’s browser.

This works ok, and has been tested in different setups as: windows server, windows 10 pro, dedicated servers and shared virtual instances, and with different GPU’s like RTX 3090, GTX 1660 super, GTX 1060 and Titan.

Problem:

We noticed that in all our different setups, with small hardware specs and even powerful dedicated servers (64GRAM, 2x RTX 3090) we are able to execute the game-pixel several times but up to only 3 instances, more than that will crash the game. Again: always only 3 instances no matter the hardware specs.

If we run the game but we do not connect with its stream, we can run a lot more than that, we were able to execute up to 25 instances with no issues and I estimate we could run 50 more easily, our hardware is powerful enough to accommodate this number.

Same with the signaling server, I can run multiple instances of the signaling server with no issues and I’m sure we could accommodate hundreds of those signaling servers since it is not resource intensive.

The problem comes when we combine them both game + signaling server. There is where we can have only up to 3 instances running.

The error:

Assertion Failed: Result == NV_ENC_SUCCESS. Which points to the NVVideoEncoder.cpp
An encoding problem with Nvidia and Unreal.

To reproduce the problem:

Following the instructions given in the official website of pixel streaming, but doing it in a way to have it multiple times in the same PC. Such as just assigning different ports per instance. We also pass the argument: -RenderOffScreen to make the game run headless.

In our setup we are using ports like:

  • 7001 (pixel streaming port) and in the signaling connected to the game (web port 8001)
  • 7002 (pixel streaming port) and in the signaling connected to the game (web port 8002)
  • 7003 (pixel streaming port) and in the signaling connected to the game (web port 8003)
  • Etc…

Expected behaviour:

Theoretically it should not be a problem to run limitless number instances except those imposed by hardware resources. If it is possible to accommodate 3 instances, why not more? The reason for this error remains unclear for us.

The issue is that all of the GPUs you have tested are consumer models (GeForce models). Pixel Streaming with Nvidia cards requires cards that support NVENC (Supporting documentation here) to encode the video to send to the browser.

As you can see here, most consumer Nvidia GPUs can only support up to 3 concurrent NVENC sessions, hence why you have found 3 to be the maximum number. If you need hardware that can support more than 3 concurrent sessions, you will need to look at the Quadro and Tesla GPU lines, both intended for professional use.

Have either of you tested this out using the Quadros that support unrestricted NVENC sessions?

Seems like the P2000 would do it, but wanted to check and see if anyone tried it first

1 Like

3090 3080 3070 2070super 2070 2060
stable operation 2 pixel streaming
3 instances is always crash :frowning:
may be my project is so big~~~~

you can check the GPU percentage, it might cause crash due to GPU loading.

Hi, how did you get 3 instances working with the same gpu?

Man how you can run multiple instances?
and for your problem you need to know that the video cards has a lock from factory in then [NVENC] controller must cards has 3 to 4 instances on the driver
but you can patch your drivers to unlock the number of instances that can run at same time look at this GitHub - keylase/nvidia-patch: This patch removes restriction on maximum number of simultaneous NVENC video encoding sessions imposed by Nvidia to consumer-grade GPUs.
this is the cheaper answer the pro answer is buy a nvidia quadro card you can look more about the models and the max concurrent sessions on this web
Video Encode and Decode GPU Support Matrix | NVIDIA Developer