Skip to content

Conversation

@MatsM16
Copy link
Contributor

@MatsM16 MatsM16 commented Nov 19, 2025

Closes #983

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

Copilot AI review requested due to automatic review settings November 20, 2025 11:46
Copilot finished reviewing on behalf of MatsM16 November 20, 2025 11:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes Nvidia GPU support for Podman container runtime by detecting the container runtime and using the appropriate flags (--device nvidia.com/gpu=all for Podman vs --gpus all for Docker).

Key Changes:

  • Extracted Nvidia GPU configuration into a separate WithNvidiaGPUSupport method that checks the container runtime
  • Added GetContainerRuntime helper method to read container runtime from configuration (supports both ASPIRE_CONTAINER_RUNTIME and legacy DOTNET_ASPIRE_CONTAINER_RUNTIME)
  • Refactored tests to use helper methods (AssertSingleResource and AssertContainerRuntimeArgs) to reduce duplication

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/CommunityToolkit.Aspire.Hosting.Ollama/OllamaResourceBuilderExtensions.cs Adds runtime detection logic to apply correct GPU arguments for Podman vs Docker, introduces WithNvidiaGPUSupport and GetContainerRuntime helper methods
tests/CommunityToolkit.Aspire.Hosting.Ollama.Tests/AddOllamaTests.cs Refactors GPU tests with helper methods, adds tests for Podman with both new and legacy configuration keys

@MatsM16 MatsM16 changed the title Use correct container runtime args for nvidia gpus on podman [Ollama] Fix container runtime args for nvidia GPU on podman Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama integration has incorrect args on podman

2 participants