Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Introducing GPU support for Podman AI Lab

Harness the power of your local GPU for containerized AI workloads

September 10, 2024
Evan Shortiss Cedric Clyburn
Related topics:
Artificial intelligenceContainersDeveloper Tools
Related products:
Podman Desktop

Share:

    The world of artificial intelligence and machine learning is evolving rapidly, and with it, the tools developers use to create AI-powered applications. We're excited to announce a significant enhancement to Podman AI Lab that will improve developer experience: GPU acceleration. 

    GPU acceleration, available in Podman Desktop 1.12 and later, allows developers to harness the power of their local GPU for AI workloads that are deployed in containers, bringing new speed and efficiency to AI development on the desktop.

    To read about all the other features that were delivered in the Podman 1.12 release, visit the Podman Desktop 1.12 announcement blog post.

    Get started with GPU support for Podman AI Lab

    GPU accelerated inference can provide significant performance improvements when working with large language models (LLMs). To get started, you’ll need:

    • Podman Desktop 1.12+
    • Podman 5.2.0+
    • Podman AI Lab 1.2.0+

    If you’re using a version of Podman prior to 1.12, or haven’t used Podman before, visit the downloads page to get the latest version and follow the installation instructions to get up and running. When you launch Podman Desktop 1.12, it will prompt you to update your Podman installation to Podman 5.2.0 if you have an older version of Podman installed.

    Once you’re running up to date versions of Podman and Podman Desktop, follow the instructions to enable GPU container access in the Podman Desktop documentation. For example, on macOS this requires you to recreate the underlying Podman machine to enable GPU access via libkrun.

    Download the Podman AI Lab extension from the Extensions screen in Podman Desktop, or wait for it to update if you had a prior version installed. If the version 1.2 or greater is not listed, click the Refresh the catalog button (Figure 1).

    The extensions screen in the Podman Desktop application, showing the AI Lab extension.
    The extensions screen in the Podman Desktop application, showing the AI Lab extension.
    Figure 1: Locate the AI Lab extension on the Extensions screen in the Podman Desktop application.

    The latest version of the AI Lab extension brings new AI Recipes (starter projects for AI use cases), an expanded catalog of Apache 2.0 licensed models, and most importantly, model serving with GPU acceleration enabled. 

    Once you’re familiar with Podman AI Lab you use it as part of your workflow to build complex AI applications that integrate Natural Language Processing (NLP), Retrieval-Augmented Generation (RAG), and model alignment as demonstrated with Market Maestro by Vincent Caldeira.

    Last but not least, make sure the Experimental GPU flag is enabled in Settings > Preferences Extension: AI Lab (Figure 2).

    The AI Lab extension's preferences page, showing the Experimental GPU flag.
    The AI Lab extension's preferences page, showing the Experimental GPU flag.
    Figure 2: The AI Lab extension's Preferences page, with the Experimental GPU flag enabled.

    Using Podman AI Lab with GPU Inference

    Everything’s in place, so you can head over to the AI Lab extension and use the Catalog to download a model (Figure 3). Subsequent examples will use the instruct lab/granite-7b-lab-GGUF.

    The Models screen, as seen in the Podman Desktop AI Lab extension.
    The Models screen, as seen in the Podman Desktop AI Lab extension.
    Figure 3: The Models screen, as seen in the Podman Desktop AI Lab extension.

    Serve models with GPU acceleration

    To serve a model, select the Services section within the AI Lab extension and click the New Model Service button (Figure 4). Select a model and click Create service.

    Creating a model service in Podman Desktop.
    Creating a model service in Podman Desktop.
    Figure 4: Creating a model service in Podman Desktop.

    After a few moments you’ll be able to view the Service details and interact with the model (Figure 5). If all went well, you should see that GPU Inference is enabled.

    The Service details screen, showing that GPU Inference is enabled.
    The Service details screen, showing that GPU Inference is enabled.
    Figure 5: The Service details screen, with GPU inference enabled.

    Test the service using the sample cURL command displayed, or use the dropdown to obtain a code snippet to use to communicate with the model from your preferred runtime. You should receive a reasonably snappy response to your requests with GPU inference enabled.

    Figure 6 shows logs from a Service using CPU-based inference. As everything is running with containers, those logs are available from the inference server container’s details. The eval time runs at ~9.4 tokens per second.

    Logs from a container using CPU Inference
    Logs from a container using CPU Inference
    Figure 6: Logs from a container using CPU inference.

    Comparing the prior logs to a container using GPU-based inference (Figure 7) demonstrates an almost 3x performance improvement in the eval time when responding to a prompt . These tests were performed on a MacBook with an M3 processor and 6 cores provided to the underlying Podman machine.

    Logs from a container using GPU-based inference.
    Logs from a container using GPU-based inference.
    Figure 7: Logs from a container using GPU-based inference.

    Test playgrounds with GPU acceleration

    To test the model and tune parameters, head over to the Playgrounds. Create a new playground and define a system prompt. You could use “You’re a helpful travel guide. Provide concise travel tips in response to user queries.” as the system prompt, as shown in Figure 8.

    Using a Playground in Podman Desktop to interact with a model by defining custom prompts.
    Using a Playground in Podman Desktop to interact with a model by defining custom prompts.
    Figure 8: Use a playground in Podman Desktop to interact with a model by defining custom prompts.

    Asking the model “What should I do during a 7 day trip to Paris?” will return a sample travel itinerary. On a MacBook with a M3 processor, the response to this prompt was generated in 26 seconds using GPU inference versus 85 seconds for CPU-based inference.

    Conclusion

    By leveraging the power of GPUs, developers can now inference models faster and build AI-enabled applications with quicker response times using the Podman AI Lab extension with Podman Desktop. We're excited to see what you'll build with these new capabilities! 

    For more information on Podman AI Lab and its features, visit the Podman Desktop documentation and the Podman AI Lab extension page.

    Related Posts

    • Introducing Podman AI Lab: Developer tooling for working with LLMs

    • Working with Kubernetes in Podman Desktop

    • How to install and use Podman Desktop on Windows

    • 3 advantages of Podman vs. Docker

    • Deploy and test Kubernetes containers using Podman Desktop

    • Getting started with Podman AI Lab

    Recent Posts

    • Alternatives to creating bootc images from scratch

    • How to update OpenStack Services on OpenShift

    • How to integrate vLLM inference into your macOS and iOS apps

    • How Insights events enhance system life cycle management

    • Meet the Red Hat Node.js team at PowerUP 2025

    What’s up next?

    Read Podman in Action for easy-to-follow examples to help you learn Podman quickly, including steps to deploy a complete containerized web service.

    Get the e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue