code: def get_nvcc_version(nvcc):
      cmdline = [nvcc, "--version"]
      result, stdout, stderr = call_capture_output(cmdline)
  
      if result != 0 or not stdout:
          from warnings import warn
  
          warn("NVCC version could not be determined.")
          stdout = "nvcc unknown version"
  
      return stdout.decode("utf-8", "replace")
  
imports: from pytools import memoize
  import os
  import sys
  from tempfile import mkstemp
  from os import unlink
  from pytools.prefork import call_capture_output
label_desc: Use image node_id 1 for calling a global function with example usage: get_nvcc_version(nvcc) and returns: stdout