ollama - ✅(Solved) Fix Installer exits early when nvidia-smi is found even if no nvidia gpu is present [1 pull requests, 5 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15184Fetched 2026-04-08 01:58:10
View on GitHub
Comments
5
Participants
3
Timeline
11
Reactions
0
Author
Timeline (top)
commented ×5cross-referenced ×2referenced ×2labeled ×1

Fix Action

Fixed

PR fix notes

PR #15188: Fix: verify actual NVIDIA GPU presence before exiting installer

Description (problem / solution / changelog)

Summary

Fixes issue #15184 - Installer exits early when nvidia-smi is found even if no NVIDIA GPU is present.

Problem

The installer was checking only if nvidia-smi tool is available, not if an actual NVIDIA GPU exists. This caused the installer to skip AMD GPU detection on systems that have AMD hardware but have nvidia-smi installed (e.g., from nvidia-utils package without actual GPU).

Fix

  • Check for actual NVIDIA GPU via lspci and lshw in addition to nvidia-smi
  • Use nvidia-smi --query-gpu to verify GPU is actually present
  • Allow installer to continue to AMD detection if no real NVIDIA GPU found

Testing

This fix ensures that:

  1. Systems with actual NVIDIA GPUs still work correctly
  2. Systems with AMD GPUs but nvidia-smi installed get ROCm installed
  3. Mixed GPU configurations are properly detected

Changed files

  • scripts/install.sh (modified, +17/-3)
RAW_BUFFERClick to expand / collapse

What is the issue?

When nvidia-smi is available in the system, the installer thinks its done before trying to discover amd cards and install rocm support. In fact it appears the installer would skip installalation of cuda as well as that happens later in the script, but im not sure if thats an issue.

nvidia-smi can be installed through the nvidia-utils-xxx package without nvidia hardware present, can be left over from previous hardware installation or there could be both nvidia and amd cards present. So this affects both singe card as well as mixed-card setups.

 # check_gpu nvidia-smi simply checks if nvidia-smi is available to call, i.e. installed in the system

 if check_gpu nvidia-smi; then  
     status "NVIDIA GPU installed."
     exit 0     #        <--------  installer exits 
 fi

 if ! check_gpu lspci nvidia && ! check_gpu lshw nvidia && ! check_gpu lspci amdgpu && ! check_gpu lshw amdgpu; then
     install_success
     warning "No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode."
     exit 0
 fi
 
 #                      v--------   install rocm support
 if check_gpu lspci amdgpu || check_gpu lshw amdgpu; then
      download_and_extract "https://ollama.com/download" "$OLLAMA_INSTALL_DIR" "ollama-linux-${ARCH}-rocm"   
     install_success
     status "AMD GPU ready."
     exit 0
 fi

To solve this the exit 0 calls should probably be removed in the nvidia and amd check (the latter to allow cuda installation for mixed gpu setups).

Relevant log output

OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.19.0

extent analysis

TL;DR

Remove the exit 0 calls in the NVIDIA and AMD GPU checks to allow for proper installation of CUDA and ROCm support in mixed GPU setups.

Guidance

  • Identify the lines with exit 0 in the installer script and remove them to prevent premature termination.
  • Verify that the installer correctly detects and installs support for both NVIDIA and AMD GPUs after modifying the script.
  • Test the installer in different scenarios, including single-card and mixed-card setups, to ensure proper functionality.
  • Consider adding additional logging or debugging statements to monitor the installer's progress and detect potential issues.

Example

# Modified code snippet
if check_gpu nvidia-smi; then  
    status "NVIDIA GPU installed."
    # Remove exit 0 to continue with the installation process
fi

# ...

if check_gpu lspci amdgpu || check_gpu lshw amdgpu; then
    download_and_extract "https://ollama.com/download" "$OLLAMA_INSTALL_DIR" "ollama-linux-${ARCH}-rocm"   
    install_success
    status "AMD GPU ready."
    # Remove exit 0 to allow for CUDA installation in mixed GPU setups
fi

Notes

The provided solution assumes that removing the exit 0 calls will allow the installer to correctly detect and install support for both NVIDIA and AMD GPUs. However, additional testing and verification are necessary to ensure the installer functions as expected in different scenarios.

Recommendation

Apply the workaround by removing the exit 0 calls in the NVIDIA and AMD GPU checks, as this will allow the installer to continue with the installation process and potentially fix the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - ✅(Solved) Fix Installer exits early when nvidia-smi is found even if no nvidia gpu is present [1 pull requests, 5 comments, 3 participants]