gpu

package module
v0.0.0-...-4fe1909 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package gpu is the GPU/VFIO HOST-DETECTION plugin (cutover C11): the sysfs/exec probing that charly core formerly held in charly/devices.go. It was carved out behind thin in-core resolve+Invoke shims (DetectGPU / DetectAMDGPU / DetectVFIO / DetectHostDevices / EnsureCDI / MemlockLimitBytes / VfioGroupAccessible + detectAMDGFXVersion, all in charly/gpu_shim.go). The DRIVER-SWITCH (vfio<->nvidia rebind) ALSO lives in this plugin now (cutover C9, switch.go — served over verb:gpu's OpRun DRIVER-SWITCH actions); auto-allocation (gpu_allocate.go) stays in core as a host-side VmSpec orchestrator consuming the DetectVFIO shim.

Compiled-in (an in-proc inprocProvider): the deploy/config hot paths call the shims many times, and MemlockLimitBytes must read charly's OWN process RLIMIT_MEMLOCK — both require in-process placement.

The three static data tables (device_patterns / gpu_vendors / pci_class_labels) are NOT baked here: they live in charly's embedded charly.yml (a must-stay core consumer, `charly doctor`, reads device_patterns) and are threaded in via spec.GpuProbeInput, so there is ONE data source (R3).

Package gpu — the OpRun Invoke entrypoint. charly's in-core Detect* / EnsureCDI / MemlockLimitBytes / VfioGroupAccessible / detectAMDGFXVersion shims (gpu_shim.go) resolve verb:gpu and Invoke OpRun with a spec.GpuProbeInput whose Action selects the host probe; this provider runs the matching sysfs/exec detection and returns a spec.GpuProbeReply. The three static data tables ride in on the input (they stay in charly's embedded charly.yml — see detect.go for the carve-out rationale).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMeta

func NewMeta() pb.PluginMetaServer

NewMeta advertises verb:gpu serving OpRun (via sdk.NewMeta → BuildCapabilities). The verb is invoked with the structured spec.GpuProbeInput, not an authored plugin_input, so it declares no #*Input — the shipped schema ships only the trivial #GpuInput so the host's plugin-schema gate has a non-empty, base-spliceable schema.

func NewProvider

func NewProvider() pb.ProviderServer

NewProvider builds the gpu provider.

Types

type NvidiaHolder

type NvidiaHolder struct {
	PID  int
	Comm string
}

NvidiaHolder is one process holding an /dev/nvidia* device open.

Directories

Path Synopsis
cmd
serve command
Command serve is the OUT-OF-PROCESS entrypoint shim for the gpu plugin.
Command serve is the OUT-OF-PROCESS entrypoint shim for the gpu plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL