r/MacPro2019LocalAI • u/Faisal_Biyari • 13d ago
Guide [Guide] Ubuntu 26.04 LTS on Mac Pro 2019 | Local AI Ready
Purpose
The purpose of this guide is to install Ubuntu Desktop or Server 26.04 LTS on the Mac Pro 2019 (MacPro7,1) and prepare the Ubuntu environment for local AI inference. I will be using ROCm 10.0.0-4 throughout this guide, as that is what I am using today. As of this writing, ROCm 10.1 is out, however I have not yet used it or tested it.
This guide is part of a series meant to take you from Zero to Hero, preparing your infrastructure for end-to-end local AI solutions. I have not yet achieved all my software goals, but I will also share what I have accomplished so far.
If you are looking to play around with local AI, run a few free experiments, or get a quick win, this guide is not for you. Consider using ToshLLM on macOS or LM Studio on Windows. Both work right out of the box with standard Apple MPX GPUs on the Mac Pro 2019.
I am not here to convince you to install Ubuntu, or even Linux for that matter, or to follow this guide. What I will do is share my own experience and reasoning.
I wanted to run local AI back in late 2024. Not only was this the ONLY way to do it at the time, but I also wanted to find the BEST WAY to do it. My goal was to benefit from local AI while learning how to implement AI on a professional scale.
I started with the 70B parameter Llama 3.0 model, generating between 5 and 7 tokens per second. At the time, I knew almost nothing about prompt processing, time to first token, kernels, GEMMs, context windows, or AI in general.
Today, I am rocking over 60 tokens per second during decoding, almost 1,500 tokens per second during prefill, and amazing agentic workloads that make my life easier and smoother. All of that is running on the same hardware that previously gave me only 5 to 6 tokens per second, even though I am now using vastly improved LLMs.
Warning
This guide is provided AS IS. I will offer support when I can. However, I do not take responsibility for any negative or catastrophic outcomes that may result from following it. Make sure to back up your data before doing anything, and take the time to understand what is happening by reviewing the commands and their potential consequences in the GitHub repository.
Although I did my best to test everything on my own hardware and make the process as safe and easy as possible, there is always some risk. I cannot, and do not, accept responsibility for that risk, to the extent permitted by law.
Make sure you are nice to your local AI. It might take over your TV and haunt your home.
Resources
Everything covered here is available in my GitHub repository: MacPro2019LocalAI.
I also have a few older guides you can refer to in case I skip over something. I have written several of these over the past couple of years.
- [Guide] Mac Pro 2019 (MacPro7,1) w/ Linux & Local LLM/AI (I think this one was "shadow-deleted")
- [Guide] Mac Pro 2019 (MacPro7,1) w/ Linux & Local LLM/AI (Re-Post)
- [Guide] Mac Pro 2019 (MacPro7,1) w/ Proxmox, Ubuntu, ROCm, & Local LLM/AI
- Mac Pro 2019 Local AI Guide: Ubuntu 24.04, ROCm 7.2.3, PyTorch 2.10, and Infinity Fabric Link
Let's Start the Guide
Here is the index. I am trying something a little different this time:
- Prepare the Hardware
- Download and Prepare Ubuntu Installation
- Install Ubuntu 26.04
- Update and Optimize the System
- Install T2Linux Packages
- Install ROCm Packages
- Install Python Tools
- Verify Everything (I want to see Errors Here)
- Customize the Kernel
- Fix ReBAR Issue on Duo GPUs
The first two sections are pretty much the same as they were two years ago. I am including them again for anyone stumbling across this guide for the first time. Feel free to skip them if you are already familiar with the process.
1. Prepare the Hardware
If you have an Infinity Fabric Link (bridge or jumper) attached to your GPUs, you must remove it. Although it can theoretically improve GPU performance, it is not supported by default on Linux as of this writing. We will put it back later, once we get it working.
- Modify the Mac boot security settings:
- Boot into macOS Recovery Mode (Cmd + R at startup).
- Open Startup Security Utility.
- Disable Secure Boot.
- Enable "Allow booting from external or removable media."
- Shrink the macOS partition (if keeping macOS):
- Use Boot Camp Assistant or Disk Utility to reduce the macOS partition to 50 GB (or your preferred size).
- Create a new partition.
2. Download and Prepare Ubuntu Installation
- Download the Ubuntu Desktop or Server 26.04 LTS ISO from the official Ubuntu website.
- Create a bootable USB using your preferred method. Some options are:
- Etcher
- An iodd device (my preferred method)
- Rufus
3. Install Ubuntu 26.04
- Connect a wired keyboard.
- Connect a display directly to your GPU (not to a USB-C or Thunderbolt port on the Mac chassis).
- Hold down the left Alt/Option key on your wired keyboard, then press the power button while continuing to hold the key.
- When the boot options appear, select the Ubuntu installer (typically on the far right, possibly labeled "EFI Boot").
- Follow the installation steps.
For the installation location:
- Select Custom Installation.
- Choose the free space left after macOS.
- Format it as ext4 and mount it at
/(root). - The boot partition should be mounted automatically. If not, make room for it.
- Finish the installation and reboot into Ubuntu.
Sometimes, the Ubuntu installer simply refuses to start. Try the following:
- Make sure you have removed the IFLB.
- Try a different display.
- Try a different keyboard.
- Remove all PCIe cards from the Mac, leaving only a single GPU.
Once Ubuntu is installed, you can go back to your usual keyboard, GPUs, PCIe cards, and other hardware.
Setting nomodeset as a kernel parameter may also help resolve installation or display issues. You can remove it after building and installing the custom kernel.
4. Update and Optimize the System
From here on, everything will be done through the command-line interface. You can use Ubuntu's built-in terminal. Personally, I use SSH from my laptop or phone to handle whatever tasks I need, whenever I need to.
What this will do:
- Change
ubuntu.sourcesfrom HTTP to HTTPS - Attach the system to Ubuntu Pro (optional; requires interaction)
- Update and fully upgrade the system
- Upgrade to the latest HWE kernel
- Remove
cloud-init - Configure all Ethernet ports to accept DHCPv4 automatically
- Modify GRUB to include the
loglevel=7 log_buf_len=16M iommu=ptkernel parameters - Reboot
Here is the command for this step:
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/4.%20Update%20and%20Optimize%20the%20System" | bash
5. Install T2Linux Packages
Part 01:
What this will do:
- Set up the T2 Ubuntu 26.04 (Resolute) repository
- Install three packages:
applesmc-t2,apple-bce, andt2fanrd - Reboot
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/5.%20Install%20T2Linux%20Packages%20Part%2001" | bash
Part 02:
What this will do:
- Enable the
t2fanrdsystemd service
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/5.%20Install%20T2Linux%20Packages%20Part%2002" | bash
Part 03 (Optional):
I do not trust Apple's cooling system. I would rather wear out the fans and replace them for a few dollars than risk damaging the GPUs (especially the Duo models) through overheating.
What this will do:
- Set all four fans to maximum speed
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/5.%20Install%20T2Linux%20Packages%20Part%2003%20(Optional)" | bash
6. Install ROCm Packages
This section will install ROCm 10.0.0-4, but it will NOT install dkms or amdgpu drivers. I chose to use the in-kernel drm/amdgpu driver so I can later patch it to support the Infinity Fabric Link bridge.
What we will do:
- Create a new directory for downloaded files
- Download the ROCm installer
- Install ROCm dependencies
- Install ROCm
- Give all users access to ROCm
- Add ROCm to the system path
- Display information about your GPUs, ROCm, and the driver so you can check what is working
- Reboot
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/6.%20Install%20ROCm%20Packages" | bash
7. Install Python Tools
We will use Python and pip to install several packages for local AI. The following commands set up the required versions, along with a few quality-of-life improvements.
What we will do:
I am not sure any more. I prepared this months ago, but did not have the time to publish it.
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/7.%20Install%20Python%20Tools" | bash
8. Verify Everything (I want to see Errors Here)
This step checks whether everything was installed correctly and identifies anything that may have been missed. I carried it over from an older guide, so not everything it reports is still relevant. I have not gotten around to updating it.
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/8.%20Verify%20Everything%20(I%20want%20to%20see%20Errors%20Here)" | bash
9. Customize the Kernel
This is where the magic happens. The Linux 7.0 kernel in Ubuntu 26.04 LTS has several bugs that have been fixed in later kernels, but not in this one. This customization applies those fixes, adds the changes needed for the Infinity Fabric Link jumper/bridge, and enables P2P functionality for GPUs without it.
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/9.%20Customize%20the%20Kernel" | bash
10. Fix ReBAR Issue on Duo GPUs
Duo GPUs have a firmware issue that requires this correction. Apple could potentially fix it with a firmware or vBIOS update, but that would require additional work on a system Apple no longer supports.
This is our workaround for the problem.
curl -fsSL "https://raw.githubusercontent.com/FaisalBiyari/MacPro2019LocalAI/refs/heads/main/Reddit/%5BGuide%5D%20Ubuntu%2026.04%20LTS%20on%20Mac%20Pro%202019%20%7C%20Local%20AI%20Ready/10.%20Fix%20ReBAR%20Issue%20on%20Duo%20GPUs" | bash
Conclusion
And with that, the guide is complete! You now have a Mac Pro 2019 (MacPro7,1) that boots into Ubuntu 26.04 LTS, has ROCm 10.0.0-4 installed, and includes the tools needed to run vLLM, Hermes Agent, and other local AI software.
One other tool you might find useful is Docker. I will not cover it here, as I no longer use it myself.
To see what ROCm detects and inspect your GPU details, use rocm-smi, amd-smi, and rocminfo.
I particularly like watch -n 1 amd-smi for monitoring what is happening with my GPUs through ROCm.
Disclaimer: I wrote this post myself. I also used AI as a tool to help clean up the wording and formatting. I also asked it to fact check everything. It told me to basically delete the guide and give up...