Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20624 Discussions

Insufficient performance of wglDXLockObjectsNV for small textures

Ivan_Kalugin
Beginner
771 Views

Hello, I am a developer in AxxonSoft

We use Intel QuickSync for video decompression and then NV_DX_interop extension to share Direct3D textures for our OpenGL renderer.

It seems that wglDXLockObjectsNV API function gives unexpectedly low performance when used with a lot of textures of small size

 

I have prepared a test example. The texture is created in Direct3D 11 API and then shared for OpenGL using wglDXLockObjectsNV/wglDXUnlockObjectsNV functions. That happens in loop in a single thread.

When texture size is 4096x4096 (TEXTURE_WIDTH and TEXTURE_HEIGHT constants) it is possible to make ~100 wglDXLockObjectsNV calls per second, which gives us copying about 6GB/s of texture data (considering texture size and DXGI_FORMAT_R8G8B8A8_UNORM format). GPU usage in Windows Task Manager is about 100% (3D). Looks acceptable.

But when texture size is 128x128, we have just ~2000 wglDXLockObjectsNV calls per second, that is ~100MB/s, which seems incredibly low, while GPU usage is still about 80%. The situation doesn't change if we create 1000 textures (TEXTURE_COUNT = 1000) and try to lock them at once in a single wglDXLockObjectsNV call. It is still possible to lock only 2000 textures per second.

 

So there are two questions:
1. Why is wglDXLockObjectsNV so slow for small textures and why does it still give high GPU usage? Looks like there is always created and copied some large block of data, even if the requested texture is of minimal size.
2. Why does wglDXLockObjectsNV call give significant GPU usage? There are no explicit requirements made for OpenGL texture pixel format or packing. Direct3D texture data are already in videomemory. So no obvious need for format conversion or pixel data movement. Is it not possible to just share videomemory pointer and use it by both textures, whereas access is sequential and guarded by wglDXLockObjectsNV/wglDXUnlockObjectsNV calls?

 

There are test example sources and compiled exe attached.

My system: Windows 10 x64 Pro 10.0.17134
CPU: Intel Core i7-7700@3.6GHz
GPU: Intel(R) HD Graphics 630
GFX Driver Version: 30.0.101.1191
RAM: 32GB

Thanks in advance for your assistance!

Labels (1)
0 Kudos
2 Replies
DeividA_Intel
Employee
737 Views

Hello Ivan_Kalugin,  


 

Thank you for posting on the Intel® communities.   


I would like to let you know that we have a specific forum for this kind of issue, it is called the Intel Developer Zone. There you will receive the appropriate support on this and other concerns you may have related to this issue.


Here you will find the links to access the website and the community forums:  


 

Please keep in mind that this thread will no longer be monitored by Intel.  


 

Regards,   

Deivid A.  

Intel Customer Support Technician  


0 Kudos
Reply