From 7ae759233cb5f91ca73067ceeda898657d37acd2 Mon Sep 17 00:00:00 2001 From: Allen Xu Date: Mon, 18 Dec 2023 17:32:59 +0800 Subject: [PATCH] Capture nsys for Q6 (#17) * capture nsys report Signed-off-by: Allen Xu * remove sleep Signed-off-by: Allen Xu * only for Q6 Signed-off-by: Allen Xu --------- Signed-off-by: Allen Xu --- .../scala/com/nvidia/spark/rapids/GpuColumnarToRowExec.scala | 4 ++++ .../src/main/scala/com/nvidia/spark/rapids/Plugin.scala | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuColumnarToRowExec.scala b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuColumnarToRowExec.scala index 291171ccebb..d493208f6c1 100644 --- a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuColumnarToRowExec.scala +++ b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuColumnarToRowExec.scala @@ -191,6 +191,10 @@ class AcceleratedColumnarToRowIterator( loadNextBatch() at < total } else { + val nsysStopCommand = "nsys stop" + import scala.sys.process._ + val result: String = nsysStopCommand.!! + println(s"Nsys Stop Command output: $result") itHasNext } } diff --git a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/Plugin.scala b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/Plugin.scala index 18cbd7a26bb..3da100f78c8 100644 --- a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/Plugin.scala +++ b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/Plugin.scala @@ -408,6 +408,11 @@ class RapidsExecutorPlugin extends ExecutorPlugin with Logging { extraExecutorPlugins.foreach(_.init(pluginContext, extraConf)) GpuSemaphore.initialize() FileCache.init(pluginContext) + // here customer need to make sure the path exists and is writable + val nsysStartComamnd = "nsys start -o /opt/spark/work-dir/test_%h_%p" + + ".nsys-rep" + val result: String = nsysStartComamnd.!! + println(s"Nsys Start Command output: $result") } catch { // Exceptions in executor plugin can cause a single thread to die but the executor process // sticks around without any useful info until it hearbeat times out. Print what happened