kfdtest: increase KFDPerformanceTest.P2PBandWidthTest timeout value

KFDPerformanceTest.P2PBandWidthTest[push, push] takes about 3 seconds
on 4 gfx906, the default g_TestTimeout 2 seconds is not enough to wait
for sDMA queue rptr is consumed. Use kfdtest command line option
--timeout=6000, the test is finished and result is reasonable twice as
P2PBandWidthTest[push, none]. Change P2PBandWidthTest wait timeout to 6
seconds.

Add timeout argument to function WaitOnValue, BaseQueue.Wait4PacketConsumption
SDMAQueue.Wait4PacketConsumption, PM4Queue.Wait4PacketConsumption with
default value is g_TestTimeOut.

Change-Id: I0aa04d644339feaeea695e41647ae66568beab9e
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Этот коммит содержится в:
Philip Yang
2018-12-20 13:56:01 -05:00
родитель 666f90440a
Коммит b2e026fce3
9 изменённых файлов: 15 добавлений и 14 удалений
+2 -2
Просмотреть файл
@@ -119,9 +119,9 @@ void BaseQueue::PlaceAndSubmitPacket(const BasePacket &packet) {
SubmitPacket();
}
void BaseQueue::Wait4PacketConsumption(HsaEvent *event) {
void BaseQueue::Wait4PacketConsumption(HsaEvent *event, unsigned int timeOut) {
ASSERT_TRUE(!event) << "Not supported!" << std::endl;
ASSERT_TRUE(WaitOnValue(m_Resources.Queue_read_ptr, RptrWhenConsumed()));
ASSERT_TRUE(WaitOnValue(m_Resources.Queue_read_ptr, RptrWhenConsumed(), timeOut));
}
bool BaseQueue::AllPacketsSubmitted() {
+1 -1
Просмотреть файл
@@ -64,7 +64,7 @@ class BaseQueue {
/** Wait for all the packets submitted to the queue to be consumed. (i.e. wait until RPTR=WPTR).
* Note that all packets being consumed is not the same as all packets being processed.
*/
virtual void Wait4PacketConsumption(HsaEvent *event = NULL);
virtual void Wait4PacketConsumption(HsaEvent *event = NULL, unsigned int timeOut = g_TestTimeOut);
/** @brief Place packet and submit it in one function
*/
virtual void PlaceAndSubmitPacket(const BasePacket &packet);
+1 -3
Просмотреть файл
@@ -44,9 +44,7 @@ uint64_t RoundToPowerOf2(uint64_t val) {
return val;
}
bool WaitOnValue(const volatile unsigned int *buf, unsigned int value) {
unsigned int timeOut = g_TestTimeOut;
bool WaitOnValue(const volatile unsigned int *buf, unsigned int value, unsigned int timeOut) {
while (timeOut > 0 && *buf != value) {
Delay(1);
+1 -1
Просмотреть файл
@@ -38,7 +38,7 @@ class BaseQueue;
uint64_t RoundToPowerOf2(uint64_t val);
// @brief: waits until the value is written to the buffer or until time out if received through args
bool WaitOnValue(const volatile unsigned int *buf, unsigned int value);
bool WaitOnValue(const volatile unsigned int *buf, unsigned int value, unsigned int timeOut = g_TestTimeOut);
void SplitU64(const HSAuint64 value, unsigned int& rLoPart, unsigned int& rHiPart);
+4 -1
Просмотреть файл
@@ -61,7 +61,10 @@ class AsyncMPSQ {
/* Return only when all packets are consumed.
* If there is any packet issues some IO operations, wait these IO to complete too.
*/
void Wait(void) { ASSERT_NE((HSAuint64)m_queue, NULL); m_queue->Wait4PacketConsumption(m_event); }
void Wait(void) {
ASSERT_NE((HSAuint64)m_queue, NULL);
m_queue->Wait4PacketConsumption(m_event, std::max((unsigned int)6000, g_TestTimeOut));
}
/* Report the time used between packet [begin, end) in Global Counter on success.
* Return 0 on failure.
+2 -2
Просмотреть файл
@@ -71,14 +71,14 @@ void PM4Queue::SubmitPacket() {
}
}
void PM4Queue::Wait4PacketConsumption(HsaEvent *event) {
void PM4Queue::Wait4PacketConsumption(HsaEvent *event, unsigned int timeOut) {
if (event) {
PlaceAndSubmitPacket(PM4ReleaseMemoryPacket(0,
event->EventData.HWData2,
event->EventId,
true));
EXPECT_SUCCESS(hsaKmtWaitOnEvent(event, g_TestTimeOut));
EXPECT_SUCCESS(hsaKmtWaitOnEvent(event, timeOut));
} else {
BaseQueue::Wait4PacketConsumption();
}
+1 -1
Просмотреть файл
@@ -48,7 +48,7 @@ class PM4Queue : public BaseQueue {
* 1) Less CPU usage (process can sleep, waiting for interrupt).
* 2) Lower latency (GPU only updates RPTR in memory periodically).
*/
virtual void Wait4PacketConsumption(HsaEvent *event = NULL);
virtual void Wait4PacketConsumption(HsaEvent *event = NULL, unsigned int timeOut = g_TestTimeOut);
protected:
virtual PACKETTYPE PacketTypeSupported() { return PACKETTYPE_PM4; }
+2 -2
Просмотреть файл
@@ -80,13 +80,13 @@ void SDMAQueue::SubmitPacket() {
}
}
void SDMAQueue::Wait4PacketConsumption(HsaEvent *event) {
void SDMAQueue::Wait4PacketConsumption(HsaEvent *event, unsigned int timeOut) {
if (event) {
PlacePacket(SDMAFencePacket((void*)event->EventData.HWData2, event->EventId));
PlaceAndSubmitPacket(SDMATrapPacket(event->EventId));
EXPECT_SUCCESS(hsaKmtWaitOnEvent(event, g_TestTimeOut));
EXPECT_SUCCESS(hsaKmtWaitOnEvent(event, timeOut));
} else {
BaseQueue::Wait4PacketConsumption();
}
+1 -1
Просмотреть файл
@@ -41,7 +41,7 @@ class SDMAQueue : public BaseQueue {
* 1) Less CPU usage (process can sleep, waiting for interrupt).
* 2) Lower latency (GPU only updates RPTR in memory periodically).
*/
virtual void Wait4PacketConsumption(HsaEvent *event = NULL);
virtual void Wait4PacketConsumption(HsaEvent *event = NULL, unsigned int timeOut = g_TestTimeOut);
protected:
// @ return Write pointer modulo queue size in dwords