Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/MilesONerd/neurenix/llms.txt

Use this file to discover all available pages before exploring further.

The hardware command provides tools for managing hardware configurations, including listing available devices, auto-selecting optimal hardware, and benchmarking performance.

Usage

neurenix hardware [action] [options]

Actions

ActionDescription
listList all available hardware devices (default)
infoShow current device information
autoAuto-select optimal hardware
selectManually select a specific device
benchmarkBenchmark available devices

Options

OptionTypeDefaultDescription
--devicestringNoneDevice to select (required for select action)
--precisionstringfloat32Precision (float32, float16, mixed, int8)
--memory-limitfloatNoneMemory limit in GB

Actions in Detail

list - List Available Devices

Displays all available hardware devices with their specifications.
neurenix hardware list
Available hardware devices:
1. NVIDIA GeForce RTX 3090 (cuda)
   - Memory: 24.0 GB
   - Compute capability: 8.6
   - Supported precisions: float32, float16, mixed, int8

2. Intel Core i9-12900K (cpu)
   - Memory: 64.0 GB
   - Compute capability: N/A
   - Supported precisions: float32, float16

info - Current Device Information

Shows detailed information about the currently selected device.
neurenix hardware info
Current device information:
Name: NVIDIA GeForce RTX 3090
Type: cuda
Memory: 24.0 GB
Compute capability: 8.6
Current precision: float32
Memory usage: 2.3 / 24.0 GB

auto - Auto-Select Optimal Device

Automatically selects the best available hardware based on capabilities.
neurenix hardware auto
Auto-selecting optimal hardware...
Selected device: NVIDIA GeForce RTX 3090 (cuda)
Memory: 24.0 GB
Precision: float32
Updated configuration in config.json

select - Manually Select Device

Manually choose a specific device.
neurenix hardware select --device cuda:0
Selecting hardware: cuda:0
Selected device: NVIDIA GeForce RTX 3090 (cuda)
Memory: 24.0 GB
Precision: float32
Updated configuration in config.json

benchmark - Benchmark Devices

Run performance benchmarks on all available devices.
neurenix hardware benchmark
Benchmarking available hardware...

Benchmark Results:

NVIDIA GeForce RTX 3090:
  - Inference time: 2.3456 ms
  - Training time: 12.5432 ms
  - Memory usage: 3.45 GB
  - Throughput: 856.32 samples/sec

Intel Core i9-12900K:
  - Inference time: 45.6789 ms
  - Training time: 234.5678 ms
  - Memory usage: 2.12 GB
  - Throughput: 42.67 samples/sec

Recommended device: NVIDIA GeForce RTX 3090

Examples

List available hardware

neurenix hardware list

Auto-select with mixed precision

neurenix hardware auto --precision mixed
Auto-selecting optimal hardware...
Selected device: NVIDIA GeForce RTX 3090 (cuda)
Memory: 24.0 GB
Precision: mixed
Updated configuration in config.json

Select specific GPU

neurenix hardware select --device cuda:1 --precision float16
Selecting hardware: cuda:1
Selected device: NVIDIA GeForce RTX 3080 (cuda)
Memory: 10.0 GB
Precision: float16
Updated configuration in config.json

Select CPU with memory limit

neurenix hardware select --device cpu --memory-limit 16.0
Selecting hardware: cpu
Selected device: Intel Core i9-12900K (cpu)
Memory: 64.0 GB
Precision: float32
Updated configuration in config.json

Benchmark with specific precision

neurenix hardware benchmark --precision float16
Benchmarking available hardware...

Benchmark Results:

NVIDIA GeForce RTX 3090:
  - Inference time: 1.2345 ms
  - Training time: 6.7890 ms
  - Memory usage: 1.89 GB
  - Throughput: 1624.56 samples/sec

Recommended device: NVIDIA GeForce RTX 3090

Precision Modes

float32 (Default)

Standard 32-bit floating point precision:
  • Highest accuracy
  • More memory usage
  • Slower computation
neurenix hardware select --device cuda:0 --precision float32

float16

Half-precision floating point:
  • Good accuracy
  • Reduced memory usage
  • Faster computation on modern GPUs
neurenix hardware select --device cuda:0 --precision float16

mixed

Mixed precision training:
  • Combines float32 and float16
  • Best balance of speed and accuracy
  • Recommended for modern GPUs
neurenix hardware auto --precision mixed

int8

8-bit integer quantization:
  • Lower accuracy
  • Minimal memory usage
  • Fastest inference
  • Best for deployment
neurenix hardware select --device cuda:0 --precision int8

Configuration Updates

When using auto or select actions, the hardware settings are automatically saved to config.json:
{
  "hardware": {
    "device": "cuda:0",
    "precision": "mixed"
  }
}

Use Cases

1. Initial setup

Auto-select optimal hardware when starting a new project:
neurenix init --name my-project
cd my-project
neurenix hardware auto

2. Multi-GPU selection

Select a specific GPU in multi-GPU systems:
neurenix hardware list
neurenix hardware select --device cuda:1

3. Performance optimization

Benchmark devices to find the best option:
neurenix hardware benchmark --precision mixed
neurenix hardware select --device cuda:0 --precision mixed

4. Resource-constrained training

Limit memory usage for shared systems:
neurenix hardware select --device cuda:0 --memory-limit 8.0 --precision float16

5. CPU fallback

Switch to CPU when GPU is unavailable:
neurenix hardware select --device cpu

Error Handling

No GPU available

neurenix hardware select --device cuda:0
Error managing hardware: No CUDA devices available

Invalid device

neurenix hardware select --device invalid
Error managing hardware: Device 'invalid' not found

Missing required option

neurenix hardware select
Error: --device is required for 'select' action.

Best Practices

1. Use auto-selection for new projects

neurenix hardware auto --precision mixed

2. Benchmark before production

Test different configurations to find the optimal setup:
neurenix hardware benchmark --precision float32
neurenix hardware benchmark --precision float16
neurenix hardware benchmark --precision mixed

3. Monitor device information

Regularly check device utilization:
neurenix hardware info

4. Use mixed precision on modern GPUs

For GPUs with Tensor Cores (NVIDIA Volta, Turing, Ampere):
neurenix hardware select --device cuda:0 --precision mixed

5. Document hardware configurations

Keep track of hardware settings in your experiments:
neurenix hardware info > experiment_logs/hardware_config.txt

See Also

Build docs developers (and LLMs) love