keijiro / KlakSpout

Spout plugin for Unity
The Unlicense
673 stars 101 forks source link

KlakSpout Fails to Display Spout texture created from separate display adapter. #62

Closed DenverIW closed 3 years ago

DenverIW commented 3 years ago

KlakSpout will fail to display the Spout shared texture if it was not created on the same graphics display adapter. Testing this requires use of a machine with multiple display adapters (in my particular case, an IGPU - Intel UHD graphics, and a GPU - NVIDIA 2080 Super ). The attached project is simply a new Unity Project (2019.4.10f1) with klakspout included following the directions on the github page. Additionally, the splash screen is toggled off and a text component was added to the scene to display the current SystemInfo.graphicsDeviceName to verify that the correct device was in use.

To replicate the issue, open the scene "Quad". Disable all components of type "Spout Sender" and create a build with this scene called SpoutReceiver. Then re-enable them and create another build call SpoutSender. This way, only one build is creating shared textures so there will be no naming collisions.

Using a terminal, launch each of these builds with the argument -force-device-index #. Specify a different # for the sender versus the receiver and verify that each is using a different adapter by looking at the text element near the center of the screen. Spout textures will fail to display and will appear black. This is a contrived example, but is important in situations where this plugin is used to read textures from other applications creating shared textures, and there is no guarantee what adapter the texture is created on.

SpoutTest.zip

keijiro commented 3 years ago

My understanding is that Spout only supports sharing textures in a single GPU. Could you check if other Spout-compatible apps work as you intended with your setup?

DenverIW commented 3 years ago

I think you are correct and I misunderstood Spout's capabilities. I thought this was possible running Spout through CPU mode. I know that is used as a fallback to NV_DX_interop being unavailable but I incorrectly assumed this could also address applications on separate GPUs.

Thanks for pointing that out!