Orleans.GpuBridge.HealthChecks 0.3.0

dotnet add package Orleans.GpuBridge.HealthChecks --version 0.3.0
                    
NuGet\Install-Package Orleans.GpuBridge.HealthChecks -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Orleans.GpuBridge.HealthChecks" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Orleans.GpuBridge.HealthChecks" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Orleans.GpuBridge.HealthChecks" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Orleans.GpuBridge.HealthChecks --version 0.3.0
                    
#r "nuget: Orleans.GpuBridge.HealthChecks, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Orleans.GpuBridge.HealthChecks@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Orleans.GpuBridge.HealthChecks&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Orleans.GpuBridge.HealthChecks&version=0.3.0
                    
Install as a Cake Tool

Orleans.GpuBridge.HealthChecks

Health checks, circuit breakers, and resilience patterns for Orleans GPU Bridge.

Overview

Orleans.GpuBridge.HealthChecks provides production-ready resilience patterns for GPU-accelerated applications. It includes ASP.NET Core health check integration, circuit breaker policies, and specialized GPU exception handling.

Key Features

  • GPU Health Checks: Monitor GPU device availability and health
  • Circuit Breaker Pattern: Prevent cascade failures with configurable policies
  • Specialized Exceptions: GPU-specific exception hierarchy for precise error handling
  • ASP.NET Core Integration: Standard health check endpoint support
  • Automatic Recovery: Self-healing with configurable recovery strategies

Installation

dotnet add package Orleans.GpuBridge.HealthChecks

Quick Start

Health Check Configuration

using Orleans.GpuBridge.HealthChecks;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddGpuBridge();
builder.Services.AddHealthChecks()
    .AddGpuHealthCheck(options =>
    {
        options.MinimumAvailableMemoryBytes = 1024 * 1024 * 512; // 512 MB
        options.MaxQueueDepth = 1000;
        options.HealthCheckTimeout = TimeSpan.FromSeconds(5);
    });

var app = builder.Build();
app.MapHealthChecks("/health");

Circuit Breaker Usage

using Orleans.GpuBridge.HealthChecks.CircuitBreaker;

public class GpuService
{
    private readonly ICircuitBreakerPolicy _circuitBreaker;

    public GpuService(ICircuitBreakerPolicy circuitBreaker)
    {
        _circuitBreaker = circuitBreaker;
    }

    public async Task<TResult> ExecuteWithResilienceAsync<TResult>(
        Func<Task<TResult>> operation)
    {
        return await _circuitBreaker.ExecuteAsync(operation);
    }
}

Exception Handling

try
{
    var result = await kernelCatalog.ExecuteAsync("my_kernel", input);
}
catch (GpuMemoryException ex)
{
    logger.LogWarning("GPU memory allocation failed: {Message}", ex.Message);
    // Retry with smaller batch or fallback to CPU
}
catch (GpuKernelException ex)
{
    logger.LogError(ex, "Kernel execution failed: {KernelId}", ex.KernelId);
    // Handle kernel-specific failure
}
catch (GpuDeviceException ex)
{
    logger.LogCritical(ex, "GPU device failure on device {DeviceIndex}", ex.DeviceIndex);
    // Trigger failover to another device
}

Circuit Breaker Configuration

services.AddCircuitBreakerPolicy(options =>
{
    // Failure thresholds
    options.FailureThreshold = 5;
    options.FailureTimeWindow = TimeSpan.FromMinutes(1);

    // Recovery settings
    options.OpenDuration = TimeSpan.FromSeconds(30);
    options.HalfOpenMaxAttempts = 3;

    // Exception filtering
    options.ShouldHandle = ex => ex is GpuOperationException;
});

Circuit States

State Description Behavior
Closed Normal operation Requests pass through, failures tracked
Open Circuit tripped Requests fail immediately
HalfOpen Testing recovery Limited requests allowed

Health Check Options

public class GpuHealthCheckOptions
{
    // Memory requirements
    public long MinimumAvailableMemoryBytes { get; set; } = 256 * 1024 * 1024;

    // Queue depth limits
    public int MaxQueueDepth { get; set; } = 1000;

    // Timeout settings
    public TimeSpan HealthCheckTimeout { get; set; } = TimeSpan.FromSeconds(10);

    // Temperature thresholds (Celsius)
    public int WarningTemperature { get; set; } = 80;
    public int CriticalTemperature { get; set; } = 90;

    // Device requirements
    public int MinimumDeviceCount { get; set; } = 1;
}

Exception Hierarchy

GpuOperationException (base)
├── GpuDeviceException      - Device-level failures
├── GpuMemoryException      - Memory allocation failures
└── GpuKernelException      - Kernel execution failures

GpuDeviceException

public class GpuDeviceException : GpuOperationException
{
    public int DeviceIndex { get; }
    public string DeviceName { get; }
    public DeviceErrorCode ErrorCode { get; }
}

GpuMemoryException

public class GpuMemoryException : GpuOperationException
{
    public long RequestedBytes { get; }
    public long AvailableBytes { get; }
    public MemoryType MemoryType { get; }
}

GpuKernelException

public class GpuKernelException : GpuOperationException
{
    public string KernelId { get; }
    public int ErrorCode { get; }
    public string ErrorMessage { get; }
}

Health Check Response

{
  "status": "Healthy",
  "totalDuration": "00:00:00.1234567",
  "entries": {
    "gpu": {
      "status": "Healthy",
      "data": {
        "deviceCount": 2,
        "totalMemoryBytes": 17179869184,
        "availableMemoryBytes": 12884901888,
        "averageQueueDepth": 45
      }
    }
  }
}

Dependencies

  • Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.0)
  • Orleans.GpuBridge.Abstractions

License

MIT License - Copyright (c) 2025 Michael Ivertowski


For more information, see the Orleans.GpuBridge.Core Documentation.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 93 2/9/2026
0.2.1 451 12/8/2025
0.2.0 189 12/5/2025
0.1.0 360 11/30/2025