SWDEV-482086 - Fix hipGraphInstantiate leak
* In a scenario where kernel is launched with hipExtLaunchKernelGGL and stop event is used, hipGraphInstantiate leaks. Since stop event is used, profiling is enabled and Timestamp (ReferencedCountedObject) is created, but it doesn't get released. * The idea behind this solution is that profiling should be disabled when command is captured, hence the timestamp should not be created. Because information about capturing isn't available when kernel command is created, packet capturing state is used to determine whether to create a timestamp or not. Change-Id: Ia23adac4592ded4fb5e236acf99e12e729f63692
Šī revīzija ir iekļauta:
1 vecāks
d6193a2f23
revīzija
da5f1a6146
3 files changed
+15
-13
No files matched your search
@@ -250,7 +250,7 @@ struct GraphNode : public hipGraphNodeDOTAttribute {
|
||||
node->RemoveEdge(this);
|
||||
}
|
||||
for (auto packet : gpuPackets_) {
|
||||
delete packet;
|
||||
delete[] packet;
|
||||
}
|
||||
amd::ScopedLock lock(nodeSetLock_);
|
||||
nodeSet_.erase(this);
|
||||
@@ -275,7 +275,7 @@ struct GraphNode : public hipGraphNodeDOTAttribute {
|
||||
hipError_t status = CreateCommand(capture_stream);
|
||||
gpuPackets_.clear();
|
||||
for (auto& command : commands_) {
|
||||
command->setCapturingState(true, &gpuPackets_, kernArgMgr, &capturedKernelName_);
|
||||
command->setPktCapturingState(true, &gpuPackets_, kernArgMgr, &capturedKernelName_);
|
||||
// Enqueue command to capture GPU Packet. The packet is not submitted to the device.
|
||||
// The packet is stored in gpuPacket_ and submitted during graph launch.
|
||||
command->submit(*(command->queue())->vdev());
|
||||
|
||||
Reference in new issue
Block a user