2 min read

Useful APT packages on Ubuntu 24.04 LTS and GPU access (AMD GPU)

Useful APT packages on Ubuntu 24.04 LTS and GPU access (AMD GPU)
Penguin

So you have finally installed Ubuntu 24.04 LTS with all the third-party drivers for your AMD GPU and you want to install open-source AI tools, but... you don’t know how to continue?

As a developer, I'm always a fan of using the command line, and as you might know, the Ubuntu package manager that can be used to install different software is called APT.

Before running image generation software like Stable Diffusion, Fooocus AI, ComfyUI, TTS AI tools, or asking questions against large language models (LLMs), the following packages can be installed:

  • git
  • radeontop
  • rocminfo
  • rocm-smi
  • curl
  • python3.9
  • python3.9-venv
  • python3.10
  • python3.10-venv
  • python3.11
  • python3.11-venv

Installation

To make it possible to install Python 3.10 and Python 3.11 on a newer OS like Ubuntu 24.04 LTS, the following package needs to be added to the APT repository:

sudo add-apt-repository ppa:deadsnakes/ppa -y

Refresh the APT sources list by running the following:

sudo apt update

Now it's time to install all the packages from the list above.

sudo apt install python3.9 python3.9-venv python3.10 python3.10-venv python3.11 python3.11-venv curl rocm-smi rocminfo radeontop git -y

Usage

Git can be used to download AI software.
Curl can be used to check if a web app is running.
Radeontop can be used to monitor resources in real time when running AI on your PC.
Python and python-venv can be used to create an isolated Python environment exclusively for the AI tool you want to run on your PC.

Access to GPU resources

To give the AI software access to the GPU resources, it’s important to put the user who is logged in into the render group.

Run the following steps to add the logged-in user to the render group.

  • Make sure the amdgpu kernel module is loaded:
lsmod | grep amdgpu
  • Check if your user is in the render group:
groups
  • If not, add yourself:
sudo usermod -aG render $USER
  • Log out and log back in after this.
  • Check again if your user is in the video or render group:
groups