code: def _init_nvml():
      global _nvml_lib, _no_device_warned
      if _init_pid == os.getpid():
          return
  
      nvml_paths = [
          "libnvidia-ml.so",
          "libnvidia-ml.so.1",
          "libnvidia-ml.dylib",
          "nvml.dll",
      ]
      if _is_windows:
          nvml_paths.append(
              os.path.join(
                  os.getenv("ProgramFiles", "C:/Program Files"),
                  "NVIDIA Corporation/NVSMI/nvml.dll",
              )
          )
      if _is_wsl:
          nvml_paths = [
              "/usr/lib/wsl/lib/libnvidia-ml.so.1"
          ] + nvml_paths
      _nvml_lib = _load_nv_library(*nvml_paths)
  
      if _nvml_lib is None:
          return
      try:
          _nvml_check_error(_nvml_lib.nvmlInit_v2())
      except NVMLAPIError as ex:
          if ex.errno == NVML_DRIVER_NOT_LOADED:
              _nvml_lib = None
              if not _no_device_warned:
                  logger.warning(
                      "Failed to load libnvidia-ml: %s, no CUDA device will be enabled",
                      ex.message,
                  )
                  _no_device_warned = True
          else:
              logger.exception("Failed to initialize libnvidia-ml.")
          return
  
imports: import dataclasses
  import logging
  import os
  import subprocess
  import sys
  import uuid
  from collections import namedtuple
  from ctypes import c_char, c_char_p, c_int, c_uint, c_ulonglong, byref, create_string_buffer, Structure, POINTER, CDLL
  from typing import List, Tuple, Optional, Union
  from ..utils import parse_readable_size
label_desc: Use image node_id 7 for calling a global function with example usage: _init_nvml() without return types