Files
rustytorch/crates/specialized/rtx-synthesis/src/rtx_features.rs
T
2026-03-04 00:08:42 +00:00

172 lines
4.8 KiB
Rust

//! RTX-specific hardware features and capabilities
//!
//! This module provides detailed specifications and profiling for RTX-specific
//! hardware components including RT cores, Tensor cores, and media engines.
use serde::{Deserialize, Serialize};
/// RTX-specific hardware features and capabilities
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RtxFeatures {
/// RT Core generation and specifications
pub rt_cores: RtCoreSpecs,
/// Tensor Core generation and capabilities
pub tensor_cores: TensorCoreSpecs,
/// Media acceleration engines
pub media_engines: MediaEngineSpecs,
/// GPU utilization monitoring capabilities
pub monitoring_capabilities: MonitoringSpecs,
}
/// RT Core specifications for ray tracing acceleration
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RtCoreSpecs {
/// RT Core generation (2 for RTX 30xx, 3 for RTX 40xx/50xx)
pub generation: u32,
/// Number of RT cores per SM
pub rt_cores_per_sm: u32,
/// Ray-triangle intersection throughput (billion intersections/sec)
pub intersection_throughput: f32,
/// Ray-box intersection throughput (billion intersections/sec)
pub box_intersection_throughput: f32,
/// Support for advanced ray tracing features
pub supports_motion_blur: bool,
pub supports_opacity_micromap: bool,
pub supports_displacement_micromap: bool,
}
/// Tensor Core specifications for AI/ML acceleration
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct TensorCoreSpecs {
/// Tensor Core generation (3 for Ampere, 4 for Ada Lovelace/Blackwell)
pub generation: u32,
/// Number of Tensor cores per SM
pub tensor_cores_per_sm: u32,
/// Supported data types and their peak throughput (TOPS)
pub fp16_throughput: f32,
pub bf16_throughput: f32,
pub int8_throughput: f32,
pub int4_throughput: f32,
pub fp8_throughput: f32,
/// Sparsity support (2:4 structured sparsity)
pub supports_sparsity: bool,
/// Advanced features
pub supports_mixed_precision: bool,
pub supports_fp8_formats: bool,
}
/// Media acceleration engine specifications
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct MediaEngineSpecs {
/// NVENC encoder specifications
pub nvenc: Option<NvencSpecs>,
/// NVDEC decoder specifications
pub nvdec: Option<NvdecSpecs>,
/// AV1 encoding/decoding support
pub av1_support: bool,
}
/// NVENC encoder specifications
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct NvencSpecs {
/// Encoder generation
pub generation: u32,
/// Maximum simultaneous encoding sessions
pub max_sessions: u32,
/// Supported codecs
pub h264_support: bool,
pub h265_support: bool,
pub av1_support: bool,
/// Maximum encoding resolution
pub max_resolution: (u32, u32),
/// Hardware-accelerated B-frame support
pub b_frame_support: bool,
}
/// NVDEC decoder specifications
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct NvdecSpecs {
/// Decoder generation
pub generation: u32,
/// Maximum simultaneous decoding sessions
pub max_sessions: u32,
/// Supported codecs
pub h264_support: bool,
pub h265_support: bool,
pub av1_support: bool,
pub vp9_support: bool,
/// Maximum decoding resolution
pub max_resolution: (u32, u32),
}
/// GPU monitoring and profiling capabilities
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct MonitoringSpecs {
/// NVML support availability
pub nvml_available: bool,
/// Supported monitoring metrics
pub supports_power_monitoring: bool,
pub supports_thermal_monitoring: bool,
pub supports_utilization_monitoring: bool,
pub supports_memory_usage_monitoring: bool,
pub supports_clock_monitoring: bool,
/// Sampling rates (Hz)
pub power_sampling_rate: Option<f32>,
pub thermal_sampling_rate: Option<f32>,
}
/// Thermal and power profiling data
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct ThermalPowerProfile {
/// Current GPU temperature (Celsius)
pub current_temperature: f32,
/// Maximum safe operating temperature
pub max_temperature: f32,
/// Temperature thresholds
pub thermal_throttle_temperature: f32,
pub thermal_shutdown_temperature: f32,
/// Power consumption data
pub current_power_draw: f32, // Watts
pub maximum_power_limit: f32, // Watts
pub default_power_limit: f32, // Watts
/// Clock speeds (MHz)
pub base_clock: u32,
pub boost_clock: u32,
pub memory_clock: u32,
pub current_gpu_clock: u32,
pub current_memory_clock: u32,
/// Fan and cooling data
pub fan_speed_rpm: Option<u32>,
pub fan_speed_percent: Option<f32>,
/// Power efficiency metrics
pub performance_per_watt: f32, // FLOPS/W
}