AMD ROCm 7 Installation And Testing On Fedora Linux For RX 9070

Table Of Content

  1. ComfyUI
  2. Blender

Hey guys! Today, we're diving deep into the exciting world of AMD ROCm 7 and how to get it up and running on Fedora Linux, specifically for the RX 9070. This guide is designed to help you navigate the installation process and test your setup with some killer applications like ComfyUI, Blender, LMStudio, SDNext, and Flux. Whether you're a seasoned pro or just getting started, this comprehensive walkthrough will ensure you're ready to harness the power of your AMD GPU for machine learning and creative tasks. We'll cover everything from preparing your system to troubleshooting common issues, so let's jump right in and unlock the full potential of your hardware!

Before we get our hands dirty with the installation, let's make sure we've got all our ducks in a row. Here's a checklist of prerequisites you'll need to ensure a smooth and successful ROCm 7 installation on your Fedora Linux system for your RX 9070 GPU.

  1. Compatible Hardware: First and foremost, verify that your AMD RX 9070 GPU is indeed compatible with ROCm 7. AMD maintains a list of supported GPUs on their official ROCm documentation, so it's worth double-checking to avoid any surprises down the line. ROCm is designed to work with specific AMD GPUs, and while the RX 9070 is a powerful card, ensuring compatibility is a crucial first step.
  2. Fedora Linux: This guide is tailored for Fedora Linux, so you'll need a Fedora installation up and running. We recommend using the latest stable release to take advantage of the newest features and improvements. Fedora is a fantastic choice for developers and enthusiasts due to its cutting-edge software and strong community support. If you're not already on Fedora, you might want to consider setting it up before proceeding.
  3. Kernel Version: ROCm often requires a specific kernel version to function correctly. Generally, a recent kernel is preferred, but it's essential to consult the ROCm documentation for the officially supported kernel versions. You can check your current kernel version by running uname -r in the terminal. If your kernel is outdated, you may need to update it before installing ROCm.
  4. System Updates: Before installing any new software, it's always a good idea to ensure your system is fully updated. Run sudo dnf update in the terminal to update all your packages to the latest versions. This step helps prevent compatibility issues and ensures that you have the necessary dependencies installed. Think of it as giving your system a fresh start before the main event.
  5. Sufficient Disk Space: Installing ROCm and its dependencies can take up a significant amount of disk space. Make sure you have enough free space on your root partition to accommodate the installation. A good rule of thumb is to have at least 20-30 GB of free space, but this can vary depending on the other software you have installed. Running out of disk space mid-installation can lead to errors and a frustrating experience.
  6. Internet Connection: A stable internet connection is crucial for downloading the ROCm packages and dependencies. Ensure you have a reliable connection before starting the installation process. Nobody wants a download to fail halfway through, so a solid internet connection is your best friend here.
  7. Basic Linux Knowledge: A basic understanding of Linux command-line operations will be beneficial, as the installation process involves using the terminal. Familiarity with commands like sudo, dnf, and navigating directories will make the process smoother. If you're new to Linux, don't worry! There are plenty of resources available online to help you get up to speed.

By ensuring you have these prerequisites in place, you'll be setting yourself up for a successful ROCm 7 installation on your Fedora Linux system with your RX 9070. Let's move on to the next step and get our hands dirty with the installation process!

Alright, let's get down to the nitty-gritty and walk through the step-by-step installation of AMD ROCm 7 on Fedora Linux for your RX 9070. This part can seem a bit daunting, but don't worry, we'll break it down into manageable chunks. Follow along carefully, and you'll be crunching those machine learning models in no time!

  1. Adding the ROCm Repository: The first thing we need to do is add the ROCm repository to your Fedora system. This allows dnf, the package manager, to find and install the ROCm packages. Open your terminal and add the ROCm repository by creating a new repository file. You can do this using a text editor like nano or vim. Here’s the command to get started:

    sudo nano /etc/yum.repos.d/rocm.repo
    

    Next, add the following content to the rocm.repo file. Make sure to replace the base URL with the correct one for ROCm 7 and Fedora. You can find the most up-to-date URL on the official AMD ROCm documentation. Here’s an example:

    [rocm]
    name=ROCm
    baseurl=https://repo.radeon.com/rocm/fedora/VERSION/main # Replace VERSION with your Fedora version
    enabled=1
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    

    Replace VERSION with your Fedora version number (e.g., 38, 39). Save the file and exit the text editor.

  2. Importing the GPG Key: To ensure the packages we're installing are authentic and haven't been tampered with, we need to import the ROCm GPG key. This key is used to verify the digital signatures of the ROCm packages. You can import the GPG key using the following command:

    sudo rpm --import https://repo.radeon.com/rocm/rocm.gpg.key
    

    This command tells rpm, the RPM Package Manager, to import the GPG key from the specified URL. Once the key is imported, your system can verify the ROCm packages during installation.

  3. Updating the Package Cache: Now that we've added the ROCm repository and imported the GPG key, it's time to update the package cache. This ensures that dnf is aware of the new packages available in the ROCm repository. Run the following command to update the package cache:

    sudo dnf update
    

    This command refreshes the package lists and makes sure your system knows about the newly added ROCm packages. It's a crucial step to ensure that the installation process goes smoothly.

  4. Installing ROCm: With the repository added and the package cache updated, we can finally install ROCm. Use the following command to install the ROCm meta-package, which includes all the necessary components:

    sudo dnf install rocm
    

    This command instructs dnf to install the rocm meta-package, which will pull in all the required dependencies, including the ROCm runtime, compilers, and libraries. The installation process may take some time, depending on your internet connection and system speed. Be patient and let it complete.

  5. Verifying the Installation: Once the installation is complete, it's a good idea to verify that everything is set up correctly. You can do this by running the rocm-smi command, which provides information about your ROCm installation and GPU. Open a terminal and run:

    /opt/rocm/bin/rocm-smi
    

    This command should display information about your RX 9070 GPU, including its name, device ID, and memory usage. If you see this information, congratulations! Your ROCm installation is likely successful. If not, double-check the previous steps and make sure you haven't missed anything.

  6. Setting Environment Variables: To make it easier to use ROCm, it's helpful to set some environment variables. These variables tell the system where to find the ROCm libraries and executables. Open your shell configuration file (e.g., ~/.bashrc or ~/.zshrc) in a text editor and add the following lines:

    export PATH=$PATH:/opt/rocm/bin:/opt/rocm/rocclr/bin:/opt/rocm/opencl/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib
    export HSA_OVERRIDE_GFX_VERSION=11.0.0 # Adjust this based on your GPU architecture
    

    Save the file and source it to apply the changes to your current session:

    source ~/.bashrc # or source ~/.zshrc
    

    These environment variables ensure that your system can find the ROCm executables and libraries, making it easier to run ROCm-enabled applications.

By following these steps, you should have a working ROCm 7 installation on your Fedora Linux system with your RX 9070. Now, let's move on to testing the installation with some exciting applications!

Alright, now that we've got ROCm 7 installed on your Fedora Linux system for your RX 9070, it's time for the fun part: putting it to the test! We'll explore how to verify the installation using several popular applications, including ComfyUI, Blender, LMStudio, SDNext, and Flux. These tools will help you see the real-world performance benefits of ROCm and ensure everything is running smoothly. Let's dive in and get testing!

ComfyUI

ComfyUI is a powerful and modular Stable Diffusion GUI that's perfect for testing ROCm. To get started with ComfyUI on ROCm, follow these steps:

  1. Install Dependencies: First, you'll need to install some dependencies. Open a terminal and run the following command:

    sudo dnf install git python3 python3-pip
    

    This command installs git for cloning the ComfyUI repository, python3 as the scripting language, and python3-pip for managing Python packages.

  2. Clone the ComfyUI Repository: Next, clone the ComfyUI repository from GitHub. Navigate to the directory where you want to install ComfyUI and run:

    git clone https://github.com/comfyanonymous/ComfyUI.git
    cd ComfyUI
    

    This command downloads the ComfyUI source code to your system.

  3. Install Python Dependencies: ComfyUI has several Python dependencies that need to be installed. Use pip to install them by running:

    pip3 install -r requirements.txt
    

    This command reads the requirements.txt file and installs all the necessary Python packages. Depending on your system and internet connection, this might take a few minutes.

  4. Run ComfyUI: Now, you're ready to run ComfyUI! Execute the following command:

    python3 main.py --cuda-device 0 --directml
    

    If you have issues with --directml, try running with the --cpu argument or checking the ComfyUI documentation for ROCm-specific flags. ComfyUI should start up, and you can access it through your web browser. Load a workflow and generate an image to see if your RX 9070 is being utilized correctly.

Blender

Blender is a popular open-source 3D creation suite that supports ROCm for GPU rendering. Here’s how to test ROCm with Blender:

  1. Download Blender: If you don't already have Blender installed, download the latest version from the official Blender website (https://www.blender.org/download/). Make sure to download the Linux version.

  2. Install Blender: Extract the downloaded file to a directory of your choice. You don't need to