code: def init_cuda(ignore_config=False, verbose=None):
      """Initialize CUDA functionality.
  
      This function attempts to load the necessary interfaces
      (hardware connectivity) to run CUDA-based filtering. This
      function should only need to be run once per session.
  
      If the config var (set via mne.set_config or in ENV)
      MNE_USE_CUDA == 'true', this function will be executed when
      the first CUDA setup is performed. If this variable is not
      set, this function can be manually executed.
  
      Parameters
      ----------
      ignore_config : bool
          If True, ignore the config value MNE_USE_CUDA and force init.
      %(verbose)s
      """
      global _cuda_capable
      if _cuda_capable:
          return
      if not ignore_config and (
          get_config("MNE_USE_CUDA", "false").lower() != "true"
      ):
          logger.info(
              "CUDA not enabled in config, skipping initialization"
          )
          return
      # Triage possible errors for informative messaging
      _cuda_capable = False
      try:
          import cupy  # noqa
      except ImportError:
          warn("module cupy not found, CUDA not enabled")
          return
      device_id = int(get_config("MNE_CUDA_DEVICE", "0"))
      try:
          # Initialize CUDA
          _set_cuda_device(device_id, verbose)
      except Exception:
          warn(
              "so CUDA device could be initialized, likely a hardware error, "
              "CUDA not enabled%s" % _explain_exception()
          )
          return
  
      _cuda_capable = True
      # Figure out limit for CUDA FFT calculations
      logger.info(
          "Enabling CUDA with %s available memory" % get_cuda_memory()
      )
  
file_path: mne-python/mne/cuda.py
imports: import numpy
  from scipy.fft import irfft, rfft
  from .utils import _check_option, _explain_exception, fill_doc, get_config, logger, sizeof_fmt, verbose, warn
label_desc: Use image node_id 2 for calling a global function with example usage: init_cuda(ignore_config, verbose) without return types