Skip to content

Make device_count() return 0 when there is no GPU - #3486

Merged
zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:metal-device-count
May 7, 2026
Merged

zcbenz merged 1 commit into
ml-explore:mainfrom
zcbenz:metal-device-count

Conversation

@zcbenz

@zcbenz zcbenz commented May 6, 2026

Copy link
Copy Markdown
Member

Close #3148: crash on import was gone after the thread safety changes, the mysterious NSRangeException error message was improved by #3428, and this PR solves the last piece by making it possible to detect if there is GPU access at run time.

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@zcbenz
zcbenz merged commit c9aa560 into ml-explore:main May 7, 2026
16 checks passed
@zcbenz
zcbenz deleted the metal-device-count branch May 7, 2026 23:33
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.

Headless/no-GPU environments crash on MLX import (NSRangeException) instead of failing gracefully

2 participants