tpuproxy

package
v0.0.0-...-f7ad032 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0, MIT Imports: 19 Imported by: 5

Documentation

Overview

Package tpuproxy contains tpu backend driver proxy implementations and helper functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// TPUv4DeviceRegex is the regex for detecting TPUv4 device paths.
	TPUv4DeviceRegex = regexp.MustCompile(`/dev/accel(\d+)`)

	// TPUv5DeviceRegex is the regex for detecting TPUv5 device paths.
	TPUv5DeviceRegex = regexp.MustCompile(`/dev/vfio/(\d+)`)
)

Functions

func Filters

func Filters() seccomp.SyscallRules

Filters returns seccomp-bpf filters for this package.

func RegisterTPUv4Device

func RegisterTPUv4Device(ctx context.Context, creds *auth.Credentials, root vfs.VirtualDentry, vfsObj *vfs.VirtualFilesystem, devPath string, minorNum uint32) error

RegisterTPUv4Device registers the TPUv4 device with the provided minor number where the corresponding PCI device is located at pciPath. Accel devices always have their device file number set to their minor number.

func RegisterTPUv5Device

func RegisterTPUv5Device(vfsObj *vfs.VirtualFilesystem, devPath string, minorNum uint32) error

RegisterTPUv5Device registers the TPUv5 device with the provided device path and minor number.

Types

This section is empty.

Directories

Path Synopsis
Package accel implements a proxy for gasket based accel devices.
Package accel implements a proxy for gasket based accel devices.
Package util contains helper functions for tpuproxy implementations.
Package util contains helper functions for tpuproxy implementations.
Package vfio implements a proxy for VFIO devices.
Package vfio implements a proxy for VFIO devices.

Jump to

Keyboard shortcuts

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