class_docstr: Polls smi in a forked child process, saves measurements to instance vars
code: def __runChildLoop(self, readFileNo, writeFileNo):
      childReadPipe = os.fdopen(readFileNo)
      childWritePipe = os.fdopen(writeFileNo, "w")
  
      smi.nvmlInit()
      # hack - get actual device ID somehow
      devObj = smi.nvmlDeviceGetHandleByIndex(0)
      memObj = smi.nvmlDeviceGetMemoryInfo(devObj)
      utilObj = smi.nvmlDeviceGetUtilizationRates(devObj)
      initialMemUsed = memObj.used
      initialGpuUtil = utilObj.gpu
  
      controlStr = self.__waitForInput(childReadPipe)
      while True:
          memObj = smi.nvmlDeviceGetMemoryInfo(devObj)
          utilObj = smi.nvmlDeviceGetUtilizationRates(devObj)
  
          memUsed = memObj.used - initialMemUsed
          gpuUtil = utilObj.gpu - initialGpuUtil
  
          if controlStr.strip() == "1":
              self.__writeToPipe(
                  childWritePipe, "%s %s\n" % (memUsed, gpuUtil)
              )
          elif controlStr.strip() == "0":
              break
          controlStr = self.__waitForInput(childReadPipe)
  
      smi.nvmlShutdown()
      childReadPipe.close()
      childWritePipe.close()
  
file_path: cugraph/python/utils/gpu_metric_poller.py
imports: import os
  import sys
  import threading
  from pynvml import smi
label_desc: Use image node_id 5 for calling the GPUMetricPoller obj's underlying member method code with example usage: obj.__runChildLoop(readFileNo, writeFileNo) without return types