code: def cuda_gdb(request):
      gdb = which("cuda-gdb")
      if gdb is None:
          request.applymarker(
              pytest.mark.xfail(
                  reason="No cuda-gdb found, can't detect cuInit"
              ),
          )
          return gdb
      else:
          output = subprocess.run(
              [gdb, "--version"], capture_output=True, text=True
          )
          if output.returncode != 0:
              request.applymarker(
                  pytest.mark.xfail(
                      reason=(
                          "cuda-gdb not working on this platform, "
                          f"can't detect cuInit: {output.stderr}"
                      )
                  ),
              )
          return gdb
  
imports: import os
  import subprocess
  import sys
  from shutil import which
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: cuda_gdb(request) and returns: gdb, gdb