code: def safe_get_versions():
      """
      Return a 2-tuple of deduced driver and runtime versions.
  
      To ensure that this function does not initialize a CUDA context,
      calls to the runtime and driver are made in a subprocess.
  
      If PTXCOMPILER_CHECK_NUMBA_CODEGEN_PATCH_NEEDED is set
      in the environment, then this subprocess call is not launched.
      To specify the driver and runtime versions of the environment
      in this case, set PTXCOMPILER_KNOWN_DRIVER_VERSION and
      PTXCOMPILER_KNOWN_RUNTIME_VERSION appropriately.
      """
      if check_disabled_in_env():
          try:
              # allow user to specify driver/runtime
              # versions manually, if necessary
              driver_version = os.environ[
                  "PTXCOMPILER_KNOWN_DRIVER_VERSION"
              ].split(".")
              runtime_version = os.environ[
                  "PTXCOMPILER_KNOWN_RUNTIME_VERSION"
              ].split(".")
              driver_version, runtime_version = (
                  tuple(map(int, driver_version)),
                  tuple(map(int, runtime_version)),
              )
          except (KeyError, ValueError):
              warnings.warn(
                  "No way to determine driver and runtime versions for "
                  "patching, set PTXCOMPILER_KNOWN_DRIVER_VERSION and "
                  "PTXCOMPILER_KNOWN_RUNTIME_VERSION"
              )
              return NO_DRIVER
      else:
          driver_version, runtime_version = get_versions()
      return driver_version, runtime_version
  
imports: import math
  import os
  import subprocess
  import sys
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: safe_get_versions() and returns: driver_version,  runtime_version, NO_DRIVER