Skip to content

Instantly share code, notes, and snippets.

@ldnicolasmay
Last active February 1, 2026 02:15
Show Gist options
  • Select an option

  • Save ldnicolasmay/7892d0c8455c1fa4108f51e84ab63a68 to your computer and use it in GitHub Desktop.

Select an option

Save ldnicolasmay/7892d0c8455c1fa4108f51e84ab63a68 to your computer and use it in GitHub Desktop.
PyTorch on Framework Desktop with Fedora 43 - 2026-01-31

Steps to get PyTorch running on Framework Desktop running Fedora 43

To make sense of this, start with Donato Capitella's explainer video.

To just get to a working PyTorch project, follow the steps below.

  1. Follow steps here to install the latest ROCm binaries on Fedora 43: https://www.fixnum.org/2025-11-27-rocm7-fedora43/

    sudo dnf install dnf-plugin-config-manager python3-setuptools python3-wheel
    
    # Uninstall existing ROCm packages
    sudo dnf remove rocm rocm-*
    
    # Add ROCm repositories to yum config
    sudo tee /etc/yum.repos.d/rocm.repo <<EOF
    [ROCm]
    name=rocm
    baseurl=https://repo.radeon.com/rocm/el9/latest/main/
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    
    [AMDGraphics]
    name=rocmgraphics
    baseurl=https://repo.radeon.com/graphics/latest/el/9.6/main/x86_64/
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    
    # Install ROCm and dependencies
    sudo dnf install rocm rocm-developer-tools hipblas-devel hip-devel rocwmma-devel rocm-opencl-devel --allowerasing
    
    # Enable AMD's ahead-of-time Triton math library
    echo 'export TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1' >> ~/.bashrc  # or whatever shell you use
  2. Install uv: https://docs.astral.sh/uv/getting-started/installation/

  3. Create a project directory and change into it, like mkdir ~/my-project && cd ~/my-project.

  4. In your PyTorch project, init uv, use Python 3.13, and create a project virtual environment:

    uv init --name my-project
    uv python install 3.13
    uv venv

    Make sure .python-version is set to 3.13.

  5. Follow directions to install rocm and torch / torchaudio / torchvision packages, but translating the pip commands to your project's pyproject.toml file:

    [project]
    name = "my-project"
    version = "0.1.0"
    description = "Add your description here"
    readme = "README.md"
    requires-python = ">=3.13"
    dependencies = [
      "rocm[libraries,devel]",
      "torch",
      "torchaudio",
      "torchvision",
    ]
    
    [[tool.uv.index]]
    url = "https://rocm.nightlies.amd.com/v2/gfx1151"
    
    [tool.uv]
    required-environments = [
      "sys_platform == 'linux' and platform_machine == 'x86_64'",
    ]
  6. Install the project's Python dependencies:

    uv sync
  7. Test the PyTorch installation following these instructions:

    uv run python -c 'import torch' 2> /dev/null && echo 'Success' || echo 'Failure'
    uv run python -c 'import torch; print(torch.cuda.is_available())'
  8. Copy-and-paste all the code from the PyTorch quickstart tutorial into a Python script and run it:

    uv run python pytorch_quickstart_tutorial.py # or whatever you named the script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment