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
Dieser Commit ist enthalten in:
Vladana Stojiljkovic committed 2024-09-29 11:36:53 -04:00
1 Ursprung d6193a2f23
Commit da5f1a6146
3 Dateien geändert
+15 -13

Keine Dateien entsprechen Ihrer Suche

+2 -2
Datei anzeigen
@@ -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());