Expand description
enhanced_setup_environment.sh equivalent — GPU filtering, system deps, env file, ROCm optimization.
Ports scripts/enhanced_setup_environment.sh (1411 lines) to native Rust.
This is the most complex bootstrap script, handling:
- GPU detection and filtering (discrete vs integrated)
- System dependency checking (kernel, ROCm, packages, Python)
- Environment file creation (
~/.mlstack_env) - ROCm optimization settings (HSA_OVERRIDE_GFX_VERSION, MIOpen, channel selection)
§Validation Assertions
- VAL-VBA-014: GPU filtering detects AMD GPUs via ROCm, sets HIP_VISIBLE_DEVICES
- VAL-VBA-015: System dependency checking covers kernel, ROCm, packages, Python
- VAL-VBA-016: Environment file creation produces shell-sourceable ~/.mlstack_env
- VAL-VBA-017: ROCm optimization: HSA_OVERRIDE_GFX_VERSION, ROCM_MATH_LIBS, MIOPEN_DEBUG, channel selection
Structs§
- Dependency
Check Result - Result of checking a single system dependency.
- EnvFile
Result - Result of environment file creation.
- GpuArch
Info - GPU architecture information detected from the system.
- GpuFilter
Result - Result of GPU detection and filtering.
- System
Dependency - A system dependency to check.
Functions§
- check_
all_ dependencies - Check all required system dependencies.
- check_
system_ dependency - Check a single system dependency.
- create_
env_ file - Create the
~/.mlstack_envfile with all required variables. - detect_
correct_ gpu_ arch - Detect the correct GPU architecture from marketing name.
- detect_
discrete_ gpus - Detect discrete AMD GPUs, filtering out integrated GPUs.
- generate_
env_ file_ content - Generate the environment file content.
- generate_
fish_ env_ file_ content - Generate a fish-compatible environment file.
- is_
integrated_ gpu_ name - Check if a GPU name indicates an integrated GPU.
- rocm_
version_ is_ therock - True when
versionis a TheRock-based ROCm runtime (7.14+ or 10.x+). - setup_
environment - Run the complete enhanced setup environment.