Skip to content

Hardware Command โ€‹

The hardware command provides universal GPU detection, automatic driver installation, and intelligent hardware optimization for maximum transcoding performance across NVIDIA RTX, AMD VAAPI, Intel QuickSync, and Raspberry Pi VideoCore.

Usage โ€‹

bash
usenet hardware <action> [options]

Actions โ€‹

ActionDescriptionExample
listShow hardware capabilities and recommendationsusenet hardware list
optimizeGenerate hardware-optimized configurationsusenet hardware optimize --auto
install-driversAuto-install optimal GPU driversusenet hardware install-drivers
benchmarkTest transcoding performanceusenet hardware benchmark
profileManage performance profilesusenet hardware profile balanced

Hardware Detection โ€‹

Show Capabilities โ€‹

bash
usenet hardware list

Example output for NVIDIA RTX system:

bash
๐Ÿš€ HARDWARE CAPABILITIES DETECTED

๐Ÿ’Ž GPU: NVIDIA GeForce RTX 4090
   โ€ข NVENC/NVDEC: โœ“ Available (AV1, HEVC, H.264)
   โ€ข CUDA Cores: 16,384
   โ€ข VRAM: 24GB GDDR6X
   โ€ข Driver: 545.29.06 โœ“ Optimal
   โ€ข Docker: nvidia-docker2 โœ“ Installed

๐Ÿง  CPU: Intel Core i9-13900K
   โ€ข Cores: 24 (8P + 16E)
   โ€ข Threads: 32
   โ€ข Quick Sync: โœ“ Available (AV1, HEVC, H.264)
   โ€ข AVX-512: โœ“ Supported

๐Ÿ’พ Memory: 64GB DDR5-5600
   โ€ข Available: 48GB (75%)
   โ€ข Suitable for: Dedicated performance profile

๐Ÿš€ PERFORMANCE OPTIMIZATION OPPORTUNITIES:
   โœ… 4K HEVC transcoding: 60+ FPS (vs 2-5 FPS CPU-only)
   โœ… Simultaneous streams: 8+ concurrent 4K transcodes
   โœ… AV1 encoding: 50% smaller files than H.264
   โœ… HDR tone mapping: Real-time HDR10 to SDR conversion
   โœ… Power efficiency: 50W GPU vs 200W CPU transcoding

๐Ÿ’ก RECOMMENDATIONS:
   โ€ข Use 'dedicated' performance profile for maximum throughput
   โ€ข Enable hardware transcoding in Jellyfin and Tdarr
   โ€ข Consider AV1 encoding for storage efficiency

Example output for AMD system:

bash
๐Ÿš€ HARDWARE CAPABILITIES DETECTED

๐Ÿ”ฅ GPU: AMD Radeon RX 7900 XTX
   โ€ข VAAPI/AMF: โœ“ Available (HEVC, H.264)
   โ€ข Compute Units: 96
   โ€ข VRAM: 24GB GDDR6
   โ€ข Driver: AMDGPU 23.20 โœ“ Current
   โ€ข VA-API: libva โœ“ Configured

๐Ÿง  CPU: AMD Ryzen 9 7950X
   โ€ข Cores: 16
   โ€ข Threads: 32
   โ€ข Architecture: Zen 4
   โ€ข Integrated Graphics: None

๐Ÿ’พ Memory: 32GB DDR5-5200
   โ€ข Available: 24GB (75%)
   โ€ข Suitable for: High performance profile

โšก PERFORMANCE OPTIMIZATION OPPORTUNITIES:
   โœ… Hardware HEVC encoding: 10x faster than CPU
   โœ… VAAPI acceleration: Energy-efficient transcoding  
   โœ… Dual-stream processing: Encode while serving
   โœ… HDR10 passthrough: Preserve HDR metadata

๐Ÿ’ก RECOMMENDATIONS:
   โ€ข Install mesa-va-drivers for optimal VAAPI support
   โ€ข Use 'high' performance profile for best balance
   โ€ข Enable AMF encoding in supported applications

Driver Installation โ€‹

Automatic Driver Installation โ€‹

bash
usenet hardware install-drivers

NVIDIA systems:

bash
๐Ÿ”ง Installing NVIDIA drivers...

๐Ÿ“ฆ Detecting system:
   โ€ข OS: Ubuntu 22.04 LTS
   โ€ข Kernel: 6.2.0-39-generic
   โ€ข GPU: RTX 4090

๐Ÿš€ Installing optimal drivers:
   โœ“ nvidia-driver-545 (latest stable)
   โœ“ nvidia-docker2 (container support)
   โœ“ nvidia-cuda-toolkit (development tools)

โš™๏ธ Configuring Docker integration:
   โœ“ /etc/docker/daemon.json updated
   โœ“ Docker service restarted
   โœ“ nvidia-docker runtime available

๐Ÿงช Testing installation:
   โœ“ nvidia-smi responds correctly
   โœ“ NVENC/NVDEC capabilities detected
   โœ“ Docker GPU access confirmed

โœ… Installation complete! Reboot recommended.

AMD systems:

bash
๐Ÿ”ง Installing AMD drivers...

๐Ÿ“ฆ Detecting system:
   โ€ข OS: Ubuntu 22.04 LTS  
   โ€ข GPU: RX 7900 XTX

๐Ÿš€ Installing optimal drivers:
   โœ“ mesa-va-drivers (VAAPI support)
   โœ“ libva-dev (development headers)
   โœ“ vainfo (testing utility)

โš™๏ธ Configuring VA-API:
   โœ“ /etc/environment updated
   โœ“ User added to video group
   โœ“ Device permissions configured

๐Ÿงช Testing installation:
   โœ“ vainfo shows available profiles
   โœ“ Hardware acceleration verified
   โœ“ VAAPI encoding confirmed

โœ… Installation complete!

Manual Driver Options โ€‹

bash
# Install specific driver version
usenet hardware install-drivers --version 545.29.06

# Install with development tools
usenet hardware install-drivers --include-dev

# Test installation without installing
usenet hardware install-drivers --dry-run

Performance Optimization โ€‹

Generate Optimized Configurations โ€‹

bash
usenet hardware optimize --auto

Generated optimizations:

  1. docker-compose.optimized.yml - Hardware-tuned service configurations
  2. jellyfin.xml - Transcoding settings for detected GPU
  3. tdarr_configs.json - Optimized transcoding profiles
  4. ffmpeg_profiles/ - Hardware-specific encoding presets

Performance Profiles โ€‹

bash
# Set specific performance profile
usenet hardware profile dedicated

# List available profiles  
usenet hardware profile list

# Show current profile
usenet hardware profile
ProfileCPU UsageRAM AllocationGPU UsageUse Case
light25%4GBOptionalDevelopment, testing
balanced50%8GBYesHome server (default)
high75%16GBYesDedicated media server
dedicated100%All availableYesMedia center appliance

Custom Optimization โ€‹

bash
# Optimize for specific services
usenet hardware optimize --services jellyfin,tdarr

# Optimize for specific codec
usenet hardware optimize --codec hevc

# Generate profiles for all codecs
usenet hardware optimize --all-codecs

Performance Benchmarking โ€‹

Transcoding Benchmarks โ€‹

bash
usenet hardware benchmark

Example benchmark results:

bash
๐Ÿงช TRANSCODING PERFORMANCE BENCHMARK

Test Configuration:
โ€ข Source: 4K HEVC 10-bit HDR (50 Mbps)
โ€ข Target: 1080p H.264 8-bit SDR (8 Mbps)
โ€ข Duration: 60 seconds

๐Ÿ“Š Results:

CPU-Only Transcoding:
โฑ๏ธ  Time: 180 seconds (0.33x realtime)
โšก Power: ~200W
๐ŸŒก๏ธ  Temperature: 85ยฐC
๐Ÿ“ˆ CPU Usage: 100%

GPU-Accelerated (NVENC):
โฑ๏ธ  Time: 30 seconds (2.0x realtime) 
โšก Power: ~50W total
๐ŸŒก๏ธ  Temperature: 65ยฐC
๐Ÿ“ˆ GPU Usage: 45%

Improvement:
๐Ÿš€ Speed: 6x faster
๐Ÿ’ก Power: 75% reduction  
โ„๏ธ  Temperature: 20ยฐC cooler

Custom Benchmark Tests โ€‹

bash
# Test specific codec
usenet hardware benchmark --codec hevc

# Test multiple concurrent streams
usenet hardware benchmark --streams 4

# Test different resolutions
usenet hardware benchmark --resolution 1080p,4k

Hardware Configurations โ€‹

Generated Docker Compose โ€‹

docker-compose.optimized.yml (NVIDIA example):

yaml
services:
  jellyfin:
    deploy:
      resources:
        limits:
          memory: 8G
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
    volumes:
      - ./config/jellyfin_hw.xml:/config/encoding.xml:ro

  tdarr:
    deploy:
      resources:
        limits:
          memory: 16G
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - serverIP=0.0.0.0
      - serverPort=8266
      - webUIPort=8265
      - internalNode=true
      - nodeID=MainNode

Jellyfin Hardware Transcoding โ€‹

Generated config/jellyfin_hw.xml:

xml
<EncodingOptions>
  <HardwareAccelerationType>nvenc</HardwareAccelerationType>
  <EnableHardwareDecoding>true</EnableHardwareDecoding>
  <EnableHardwareEncoding>true</EnableHardwareEncoding>
  <EnableToneMappingDecodingWithNvenc>true</EnableToneMappingDecodingWithNvenc>
  <AllowHardwareSubtitleExtraction>true</AllowHardwareSubtitleExtraction>
  <H264Crf>23</H264Crf>
  <H265Crf>28</H265Crf>
  <DeinterlaceMethod>yadif</DeinterlaceMethod>
  <EnableDecodingColorDepth10Hevc>true</EnableDecodingColorDepth10Hevc>
  <EnableEnhancedNvdecDecoder>true</EnableEnhancedNvdecDecoder>
</EncodingOptions>

Multi-GPU Support โ€‹

GPU Selection โ€‹

bash
# List available GPUs
usenet hardware list --gpus

# Optimize for specific GPU
usenet hardware optimize --gpu 0

# Use multiple GPUs
usenet hardware optimize --gpu all

Multi-GPU allocation:

bash
๐Ÿ”ง Multiple GPUs detected:

GPU 0: NVIDIA RTX 4090 (24GB) - Primary transcoding
GPU 1: NVIDIA RTX 3080 (10GB) - Secondary transcoding  

Service allocation:
โ€ข Jellyfin: GPU 0 (primary streaming)
โ€ข Tdarr: GPU 1 (background processing)
โ€ข Handbrake: GPU 0 (manual encoding)

Advanced Features โ€‹

Custom FFmpeg Profiles โ€‹

bash
# Generate custom encoding profiles
usenet hardware generate-profiles --quality high --efficiency balanced

# Create profile for specific use case
usenet hardware generate-profiles --profile "4k-archive" \
  --input-format "hevc" \
  --output-format "av1" \
  --crf 28 \
  --preset slow

Hardware Monitoring โ€‹

bash
# Real-time hardware monitoring during transcoding
usenet hardware monitor

# Monitor specific metrics
usenet hardware monitor --metrics gpu-util,temp,power

# Log monitoring data
usenet hardware monitor --log /var/log/hardware-monitor.log

Power Management โ€‹

bash
# Set GPU power limits (NVIDIA)
usenet hardware power-limit --gpu 0 --watts 300

# Enable GPU boost
usenet hardware boost enable

# Set performance mode
usenet hardware performance-mode max

Examples โ€‹

bash
# Detect hardware capabilities
usenet hardware list

# Install optimal drivers
usenet hardware install-drivers

# Generate optimized configs
usenet hardware optimize --auto

# Set high performance profile
usenet hardware profile high

# Benchmark performance
usenet hardware benchmark
bash
# Check VAAPI support
usenet hardware list

# Install VAAPI drivers
usenet hardware install-drivers

# Optimize for AMD hardware
usenet hardware optimize --amd

# Test hardware acceleration
usenet hardware benchmark --codec hevc
bash
# Detect QuickSync capabilities
usenet hardware list --intel

# Install Intel media drivers
usenet hardware install-drivers --intel

# Optimize for QuickSync
usenet hardware optimize --quicksync

# Set balanced profile (recommended for Intel)
usenet hardware profile balanced
bash
# Detect VideoCore capabilities
usenet hardware list

# Enable GPU memory split
usenet hardware configure --pi --gpu-mem 128

# Optimize for low power
usenet hardware profile light

# Test hardware decode
usenet hardware benchmark --pi-test

Troubleshooting โ€‹

Common Issues โ€‹

GPU not detected:

bash
# Check driver installation
nvidia-smi  # NVIDIA
vainfo      # AMD
intel_gpu_top  # Intel

# Reinstall drivers
usenet hardware install-drivers --force

Docker GPU access denied:

bash
# Check nvidia-docker installation
docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

# Fix permissions
sudo usermod -aG docker $USER
sudo systemctl restart docker

Poor transcoding performance:

bash
# Check hardware utilization
usenet hardware monitor

# Verify optimal profile
usenet hardware profile dedicated

# Check thermal throttling
usenet hardware temperature

Hardware Logs โ€‹

bash
# View hardware optimization logs
usenet logs hardware

# Debug driver installation
usenet hardware install-drivers --verbose

# Monitor real-time GPU usage
usenet hardware monitor --live

Performance Analysis โ€‹

bash
# Analyze transcoding bottlenecks
usenet hardware analyze

# Compare profiles
usenet hardware benchmark --compare-profiles

# Export performance report
usenet hardware report --export performance.json

Cross-Platform Support โ€‹

Platform-Specific Optimizations โ€‹

Ubuntu/Debian:

bash
# APT-based driver installation
usenet hardware install-drivers --apt

# Enable restricted repositories
usenet hardware enable-repos --non-free

CentOS/RHEL:

bash
# YUM/DNF-based installation  
usenet hardware install-drivers --yum

# Enable EPEL repository
usenet hardware enable-repos --epel

Arch Linux:

bash
# Pacman-based installation
usenet hardware install-drivers --pacman

# Enable AUR packages
usenet hardware enable-repos --aur

Container Runtimes โ€‹

bash
# Configure for Podman
usenet hardware configure --runtime podman

# Configure for containerd
usenet hardware configure --runtime containerd

# Configure for Docker with BuildKit
usenet hardware configure --buildkit
  • deploy - Include hardware optimization in deployment
  • storage - Optimize storage layout for transcoding
  • services - Configure service-specific hardware settings
  • validate - Hardware health checks

Built with โค๏ธ following Bell Labs standards. Dedicated to Stan Eisenstat.