code: def check_driver_nvml_version(driver_version_str: str):
      """Show warnings when an incompatible driver is used."""
  
      def safeint(v) -> int:
          try:
              return int(v)
          except (ValueError, TypeError):
              return 0
  
      driver_version = tuple(
          safeint(v) for v in driver_version_str.strip().split(".")
      )
  
      # #161: invalid process information on 535.xx
      is_pynvml_535_77 = (
          hasattr(
              pynvml.c_nvmlProcessInfo_t, "usedGpuCcProtectedMemory"
          )
          and
          # Note: __name__ changed to pynvml.c_nvmlProcessInfo_v2_t since 12.535.108+
          pynvml.c_nvmlProcessInfo_t.__name__ == "c_nvmlProcessInfo_t"
      )
  
      if (535, 43) <= driver_version < (535, 86):
          # See #161: these are buggy, gives wrong process information
          # except for nvidia-ml-py == 12.535.77 (which is a buggy version too).
          # Note: NVIDIA 535.86+ and nvidia-ml-py 12.535.108+ fixes the bug
          if not is_pynvml_535_77:
              warnings.warn(
                  f"This version of NVIDIA Driver {driver_version_str} is incompatible, "
                  "process information will be inaccurate. "
                  "Upgrade the NVIDIA driver to 535.104.05 or higher, "
                  "or use nvidia-ml-py==12.535.77. For more details, see "
                  "https://github.com/wookayin/gpustat/issues/161.",
                  category=NvidiaCompatibilityWarning,
                  stacklevel=2,
              )
      else:
          if is_pynvml_535_77:  # pynvml 12.535.77 should not be used
              warnings.warn(
                  "This version of nvidia-ml-py (possibly 12.535.77) is incompatible. "
                  "Please upgrade nvidia-ml-py to the latest version. "
                  "(pip install --upgrade --force-reinstall nvidia-ml-py)",
                  category=NvidiaCompatibilityWarning,
                  stacklevel=2,
              )
  
file_path: gpustat/gpustat/nvml.py
imports: import atexit
  import functools
  import os
  import sys
  import textwrap
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: check_driver_nvml_version(driver_version_str) and returns: int, int