• Content count

  • Joined

  • Last visited

Community Reputation

623 Good

About maxest

  • Rank
    Advanced Member

Personal Information

  • Interests
  1. PCI Express Throughput

    Just wanted to let you know that I made a test with CUDA to measure memory transfer rate and it peaked at around ~ 12 GB/s. Also, measuring CopyResource time with D3D11 queries result in very similar throughput.
  2. Hey, Not really sure if the right forum but hey - codecs display graphics so... :). I've been wondering how to calculate motion vectors. When encoding a video offline I can imagine one could spend enough time to search a large neighbourhood to find a motion vector that maps the current frame block to the previous frame block with minimal differences (hence achieve better compression). But what about live broadcasting where time is of value? How would a codec estimate a motion vector? Search small neighbourhood?
  3. I found a better workaround. So simple I can't imagine how I could had not come up with it before. I just used macro. Still, would be nice if this bug was fixed. In the meantime I will be using macros on functions getting shared buffers as input.
  4. I would like to run some computation using compute shaders. A lot of computation. Since GPUs have separate memory engine I thought I could make use of it, just like with CUDA streams, and have asynchronous computation and data download GPU -> CPU. So I would do something like this: Dispatch 1 (first half of data) CopyResource 1 Dispatch 2 (second hald of data) CopyResource 2 Now the question is: will CopyResource 1 and Dispatch 2 overlap in time? I heard from someone that Discard causes a flush; it waits until all previous commands have been completed and then gets called but can't find that in MSDN. Can anyone confirm?
  5. I had no idea where to start this thread so here it is. I have barely 1 message in my inbox and yet when I want to compose a new message I get "Your inbox is full. You must delete some messages before you can send any more". A bug?
  6. I thought it should have been 0.1 ms as after refactoring the whole "system" I'm working on so that I need to only download 1 MB instead of 8 MB the total processing time went down by around 1.5 ms. Thank you again so much ajmiles.
  7. I actually did try placing End query right after CopyResource and before Map and that reported (as far as I remember, can't check now) something around 0.1 ms. Now I'm not really sure how should I measure the time it takes to download data from GPU to CPU. My CPU timer, when used to enclose CopyResource and Map, reported that downloading 11.5 GB took 1 second, what agrees with some CUDA-based test application for measuring PCI-E throughput that I used. When lowered down to 8 MB the download took 1.5 ms and when lowered to 1 MB the download took 1 ms. I'm not sure if PCI-E downloads should scale linearly as a function of data size but my tests show that they don't. At least that's what my CPU timer says. But the 0.1 ms reported by GPU timer when measuring CopyResource would indicate linear scale. Now I'm not sure if I should trust the CPU time reporting 1 ms (CopyResource + Map) or the GPU timer reporting 0.1 ms (just CopyResource).
  8. @ajmiles: Thank you so so much for this detailed explanation. I hadn't thought about GPU clock changing its speed. This makes more sense that performing some redundant work :). I have checked what you proposed. Got some simple DX12 sample, called SetStablePowerState and set it to true (needed to turn on Developer Mode on on my Windows 10; wasn't aware of its existence) and called permanent Sleep. Then I ran my application. Now regardless of whether I use VSync or not, call Sleep in my app or not, I get consistent 0.46 ms. It's more than without-VSync-and-SetStablePowerState 0.4 ms but at least it's stable. So as I understand the GPU is working at lower clock speed than it could (without Boost) but this speed is fixed. I have one more case whose results I don't entirely understand. I have code of this form: -- Begin CPU Profiler (with QueryPerformanceCounter etc.) -- Begin GPU Profile CopyResource (download from GPU to CPU) Map -- End GPU Profiler do something with mapped data Unmap -- End CPU Profiler The GPU profiler reports 5 ms whereas CPU reports 2-3 ms. If anything, should the CPU timer not report time bigger than GPU? I download around 1 MB of data. When I measure with CPU timer only CopyResource and Map I get around 1 ms. I would just like to ask one more, relevant thing. In my quest for search of reliable counters I stumbled upon this ( but could find no simple example of usage. Is it working at all?
  9. I tested both. No difference. I thought about something along those lines but quickly came to a conclusion that it should not take place. I thought that everything should go and take as much time as in no-VSync case because it's the Present where the waiting happens; why would any redundant work happen in my actual computation time? I just checked how much time Present takes with VSync and indeed it's something around 15 ms, with some variance of course. So still it's a mystery to me why the computation code I profile would take more time in VSync mode. Wonder if that would also be the case under D3D12. EDIT: Encompassing the whole Render function with one disjoint ( ) actually works when VSync is off. I made wrong observation. It behvaes exactly the same as Begin/End of disjoint right before and after block we're profiling.
  10. I implemented DX queries after this blog post: Queries work perfectly fine... for as long as I don't use VSync or any other form of Sleep. Why would that happe? I record queries right before my Compute/Dispatch code, record right after and then read the results (spinning on GetData if returns S_FALSE). When I don't VSync then my code takes consistent 0.39-0.4 ms. After turning VSync on it starts with something like 0.46 ms, after a second bumps up to 0.61 ms and a few seconds after I get something like 1.2 ms. I also used this source: The difference here is that the author uses the disjoint query for the whole Render() function instead of using one per particular measurement. When I implemented it this way the timings were incosistent (like above 0.46, 0.61, 1.2) regardless of VSync.
  11. Yeah, I'm perfectly aware of that workaround and I do it this way. But because I can't pass a shared memory array to function I can't make the function more general. Instead I need to copy it to a few files I use it in.
  12. Yeah, I have D3dcompiler_47.dll indeed. I did try. Forgot to mention that in previous post. The same problem persists.
  13. I stumbled upon those threads as well and it's not it. Also, I'm not really sure how to update my d3dcompiler. I'm using Windows 10 so I presume it gets updated automatically. Although I use Visual Studio 2013 so I cannot really be sure if the most up-to-date dll is used. I found out that the problem appears even in this code: static const int ElementsCount = 512; groupshared uint tempData[2 * ElementsCount]; void MyFunc(inout uint3 gtID: SV_GroupThreadID, inout uint inputData[2 * ElementsCount]) { } [numthreads(ElementsCount, 1, 1)] void CSMain(uint3 gID: SV_GroupID, uint3 gtID: SV_GroupThreadID) {     MyFunc(gtID, tempData); } Note that I don't even write anything to tempData in MyFunc. I also found out the problem goes away if I remove the "inout" modifier but then the array just gets copied probably as the code doesn't work as expected.
  14. I have code like this: groupshared uint tempData[ElementsCount]; [numthreads(ElementsCount/2, 1, 1)] void CSMain(uint3 gID: SV_GroupID, uint3 gtID: SV_GroupThreadID) { tempData[gtID.x] = 0; } And it works fine. Now I change it to this: void MyFunc(inout uint3 gtID: SV_GroupThreadID, inout uint inputData[ElementsCount]) { inputData[gtID.x] = 0; } groupshared uint tempData[ElementsCount]; [numthreads(ElementsCount/2, 1, 1)] void CSMain(uint3 gID: SV_GroupID, uint3 gtID: SV_GroupThreadID) { MyFunc(gtID, tempData); } and I get "error X3695: race condition writing to shared memory detected, consider making this write conditional.". Any way to go around this?