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

Insufficient performance of wglDXLockObjectsNV for small textures

Ivan_Kalugin
Beginner
1,082 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
3 Replies
JosueO_Intel
Moderator
1,019 Views

Hello Ivan_Kalugin,


Thank you for posting on the Intel®️ communities. In order to have a better understanding of the issue, please share with us the following information: 


  1. Video with specific steps to try to replicate the issue.
  2. Does the issue occur on different brand GPUs?
  3. Debug results.
  4. Memory / Application dumps.
  5. App logs.
  6. How are you looking at the issue? Which tools are you using?


Also, please download and install the Intel®️ System Support Utility (Intel®️ SSU):

https://downloadcenter.intel.com/download/25293/Intel-System-Support-Utility-for-Windows- 

Open the application and select "Everything" click on "Scan" to see the system and device information. By default, Intel®️ SSU will take you to the "Summary View". Click on the menu where it says "Summary" to change to "Detailed View".  

Click on "Next", save the report and attach it to your response.



Regards, 


Josue O.  

Intel Customer Support Technician



0 Kudos
JosueO_Intel
Moderator
1,004 Views

Hello Ivan_Kalugin,


Were you able to check the previous post?  

Let us know if you still need assistance.  



Regards, 


Josue O.  

Intel Customer Support Technician



0 Kudos
JosueO_Intel
Moderator
986 Views

Hello Ivan_Kalugin,


We have not heard back from you, so we will close this thread. If you need any additional information, please submit a new question as this thread will no longer be monitored. 


Regards, 


Josue O.  

Intel Customer Support Technician



0 Kudos
Reply