microsoft / DirectML

DirectML is a high-performance, hardware-accelerated DirectX 12 library for machine learning. DirectML provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers, including all DirectX 12-capable GPUs from vendors such as AMD, Intel, NVIDIA, and Qualcomm.
MIT License
2.23k stars 297 forks source link

Too much use of GPU in 'DirectMLSuperResolution' sample #214

Open QUOPA opened 2 years ago

QUOPA commented 2 years ago

I built sources in DirectMLSuperResolution, then executed it for test. The test program showed discontinuous video play (seems having 0.5s interval between frames) with 'Super-Resolution Neural Network' option

I turned on Windows Task Manager to check GPU, and the following 4 stats were nonzero (other metrics are all zero) --> 3D, Copy, Graphics_1, Video Decode Below is the comparison between two options in the example

Bilinear (Bi) 158005486-22b431e3-4665-4ef4-8524-8b561e813af8

Super-Resolution Neural Network (NN) 158005668-fe2bfe67-2eb9-486d-9429-cafbc5bce3c6

As seen in above pictures, Graphics_1 soars to be nearly 100%, when I choose NN option According to this source, Graphics_1 represents 'DirectX12 Direct/Graphics Command Queue usage' (I don't know what exactly it is).

So. is my GPU too old to run this example? or is there something wrong in the codes?

jstoecker commented 2 years ago

There's nothing wrong with your GPU, it's simply that evaluating a neural network is going to be more computationally expensive than bilinear filtering. The neural network in this sample is not optimized or intended for use in a real-world application; it's more an education sample to illustrate the interoperability of D3D12 rendering and DirectML inference.