Okay, here is the abstract and summary for the provided transcript:
Abstract:
This video chronicles the extensive and often frustrating process of enabling AMD's ROCm compute stack, particularly for AI workloads like llama.cpp, on a 64-core RISC-V system ("RISC-V Ripper") using the T2 Linux distribution. The speaker navigates a complex web of build system issues within ROCm, including debugging inconsistent CMake flags across projects, resolving hardcoded paths, fixing linker errors, managing dependencies (HIP, Blas, FFT, RTC), and dealing with extremely long build times exacerbated by single-threaded bottlenecks on the RISC-V platform. While significant progress is made, successfully building llama.cpp with HIP acceleration on an x86 system, the RISC-V effort hits a major roadblock: a segmentation fault in Clang during the compilation of the RockSolver component. The stream highlights the immense challenges of porting complex software ecosystems to new hardware architectures and the difficulties posed by intricate and sometimes flawed build systems. Side discussions include Linux stability on Ryzen laptops and experiences with Apple Silicon/Asahi Linux.
Debugging ROCm: Enabling AI on RISC-V and Fixing Build Systems
0:00:26 The video starts with a song parodying the struggles of software development (patches, bugs, legacy code).
0:01:52Hardware Overview: The setup involves multiple systems including a powerful 64-core/128GB RAM RISC-V machine ("RISC-V Ripper", Milk-V Pioneer), a Ryzen 7950X build machine, a quad-core 7nm RISC-V prototype, and a Steam Deck for streaming.
0:02:53Primary Goal: Get AMD's ROCm compute stack (for AI/GPU compute) running on RISC-V and other architectures using the T2 Linux distribution, specifically targeting llama.cpp/llamafile.
0:07:00Initial Challenges: Weeks have already been spent packaging ROCm components, facing issues like long configure times (9 mins) and build failures due to incorrect Rust versions.
0:11:47Building ROCm Components: Starts building ROCm components like "composable kernel". Build times are significant (1h 20m on Ryzen, much longer expected on RISC-V).
0:12:53Side Discussion (Linux Stability): A viewer discusses persistent AMD GPU crashes and system instability on a Ryzen laptop running Debian Testing, prompting a discussion on potential kernel parameters and debugging methods.
0:19:18Hardware Bottleneck: Identifies slow SSD performance (~400MB/s) on the RISC-V Ripper system (DRAM-less NVMe).
0:21:45Build System Woes (CMake): Notes extremely long CMake configuration steps, highlighting single-threaded performance limitations on the RISC-V system.
0:26:33Problem (Inconsistent Flags): Discovers that different ROCm projects use inconsistent CMake variable names for specifying GPU build targets (HIP_ARCHITECTURES, GPU_TARGETS, AMDGPU_TARGETS), causing confusion and build failures.
0:37:13Debugging Linker Issues: Traces build failures to incorrect library paths derived from hipconfig output (affected by symlinks and lack of newline) and hardcoded paths in Python virtual environments used by CMake.
0:42:29Fix (Path Detection): Identifies that running hipconfig via a symlink alters its path output, breaking CMake logic. Removes the symlink as part of the fix.
0:44:14Performance Issue (Linking): Observes excessive linking times for ROCm libraries (e.g., RockBlas taking 25+ mins on Ryzen, 45+ mins on RISC-V), attributing it to code bloat and single-threaded linking steps.
0:55:09Problem (Incorrect Build Flags): Realizes a component was building for all GPUs instead of the specified ones due to using the wrong CMake variable, explaining a previous multi-hour build estimate and long runtime. Fixes the variable name in the build script.
1:04:35Integrating llama.cpp: Modifies the llama.cpp build configuration to enable the ROCm/HIP backend (-DLLAMA_HIPBLAS=ON).
1:05:26Fix (Perl Script): Patches the hipconfig Perl script which incorrectly hardcoded an LLVM library path.
1:07:01Milestone (RISC-V Build): The main ROCm component build finally completes successfully on the 64-core RISC-V Ripper after numerous fixes.
1:14:24Building llama.cpp (RISC-V): Starts the llama.cpp build on RISC-V, but it fails immediately due to missing dependencies (hipblas).
1:19:08Critical Failure (RISC-V): The build of a required dependency (rocksolver) crashes with a segmentation fault in the Clang compiler on the RISC-V system.
1:20:00Debugging the Crash: Suspects the crash might be related to an experimental kernel build with RISC-V vector extensions enabled. Plans to rebuild with a standard kernel.
1:23:41Debugging ROCm Examples (x86): Switches back to the Ryzen system to debug the ROCm example programs, which also fail to build due to missing libraries (libblas, JSON checker, hipFFT).
1:29:37More Build Issues (FFTW):hipFFT build requires FFTW compiled with single-precision float support (fftw3f), but T2 currently only provides double-precision (fftw3). Needs build system adjustment.
1:31:47More
Error: Couldn't find 1895 Build Issues (Dependencies/Linking): Discovers incorrect build order (hipFFT needs rockFFT) and further missing linker flags (-lhiprtc) required by rockFFT. Patches CMake files again.
1:35:38End Status: The builds are still plagued by linking issues and dependency problems even on x86. The RISC-V build is critically blocked by the Clang compiler segmentation fault when building rocksolver. Significant debugging and patching remain. Plans to rebuild the RISC-V kernel and continue troubleshooting.