AnsweredAssumed Answered

What's the recommended way of sending a few bytes from the GPU to host RAM, and notifying the CPU with low latency?

Question asked by sp314 on Jan 24, 2018

I have an algorithm running on the GPU that converges to a certain value.

 

I'd like to send some signals or notifications to the CPU when the GPU reaches certain points during the calculation, and attach a few (less than 128) bytes of information to the notification. The only idea I have so far is to have the GPU write to a pinned host memory location, and poll that location on the CPU side. Though, this doesn't sound like a proper solution. I'd like to get an interrupt or something on the CPU instead of polling.

 

So, what's the recommended way of sending a signal and a few bytes along with it from the GPU to the CPU?


s_sendmsg seems to be the right feature for this job, but I can't figure out how to use it or find any sample code. Is it documented anywhere, other than in the ISA docs?

 

Would anybody be able to recommend any documentation on s_sendmsg along with some code samples?

 

(Not to state the obvious, but this doesn't need to be too OpenCL standard compliant or cross-platform; we can limit this question to AMD hardware, say, Ryzen 3 and beyond for the CPU, and GCN 1.2 and the later versions for the GPU.)

 

 

Thank you all in advance.

Outcomes