Answered by:
C++ AMP: "Failed to wait for D3D marker event"?

Question
-
In one of my implementations of transpose matrix (in-place), I get a cryptic throw and error message on Windows 8 RP for a HD7870 ("Failed to wait for D3D marker event"). I'm not sure what the message means.
The implementation works fine on a GTX470 and GTX480, but not an HD7870, on Windows 8. The code works fine on that machine (all GPUs) running Windows 7. Other C++ AMP code also works fine that particular AMD device on Windows 8. For all tests, the matrix is 8192 by 8192. A snippet of the code follows:
void conv(int v, int & r, int & c) restrict(amp, cpu) { int low = 512; int high = 1024; // Establish high. for (;;) { int n = high * (high + 1) / 2; if (v < n) break; high *= 2; } // Establish low. for (;;) { int n = low * (low + 1) / 2; if (v >= n) break; low /= 2; } // Find actual bounds. for (;;) { if (high - low == 1) break; // pick mid-point between low and high. int mid = low + (high - low) / 2; int n = mid * (mid + 1) / 2; if (v >= n) low = mid; else high = mid; } r = low + 1; c = v - low * (low + 1) / 2; } …
try {int H = S->rows; int W = S->cols; array_view<float, 1> s(H * W, S->Data()); concurrency::extent<1> sz((H * W - W) / 2); parallel_for_each(acc, sz, [=] (index<1> id) restrict(amp) { int idx = id[0]; int row, col; conv(idx, row, col); int i = row; int j = col; float tmp = s[j + i * W]; s[j + i * W] = s[i + j * H]; s[i + j * H] = tmp; }); acc.wait(); s.synchronize();
} catch (runtime_exception& ex)
{
cout<< ex.what() << std::endl;
}
Ken
Friday, June 15, 2012 5:16 PM
Answers
-
Hi Ken,
Thank you for reporting this. It is a bug with AMD’s Windows 8 drivers. Wedon’t have HD 7870 series cards, but we were able to repro the bug on HD 6900 series. The TDR was thrown only for 8192 x 8192 size. It does not throw for other data sizes like 8190 x 8190 , 9216 x 9216 etc. We have reported this to the IHV.
A workaround at this point, is to either increase or decrease the size of the computational data.
Regarding the cryptic messages, sorry about that, we updated our blog post with more details to cover this scenario:
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/03/06/handling-tdrs-in-c-amp.aspx
Thanks again for reporting the driver bug.
- Pavan
- Proposed as answer by DanielMothMicrosoft employee Thursday, June 21, 2012 1:54 AM
- Marked as answer by Ken Domino Thursday, June 21, 2012 9:04 AM
Wednesday, June 20, 2012 5:50 AM
All replies
-
Hi Ken,
You have encountered a TDR exception. The more details about this TDR and how to handle it are available at the following blog posts.
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/03/06/handling-tdrs-in-c-amp.aspx
- Pavan
Friday, June 15, 2012 7:46 PM -
Hi Ken,
Thank you for reporting this. It is a bug with AMD’s Windows 8 drivers. Wedon’t have HD 7870 series cards, but we were able to repro the bug on HD 6900 series. The TDR was thrown only for 8192 x 8192 size. It does not throw for other data sizes like 8190 x 8190 , 9216 x 9216 etc. We have reported this to the IHV.
A workaround at this point, is to either increase or decrease the size of the computational data.
Regarding the cryptic messages, sorry about that, we updated our blog post with more details to cover this scenario:
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/03/06/handling-tdrs-in-c-amp.aspx
Thanks again for reporting the driver bug.
- Pavan
- Proposed as answer by DanielMothMicrosoft employee Thursday, June 21, 2012 1:54 AM
- Marked as answer by Ken Domino Thursday, June 21, 2012 9:04 AM
Wednesday, June 20, 2012 5:50 AM