admin管理员组文章数量:1357159
I'm trying to set up Docker for a Python project on my Mac and want to use MPS (Metal Performance Shaders) for GPU acceleration with PyTorch inside the container.
What I have tried so far:
- I installed Docker Desktop (the latest version of Apple Silicon) on MacOS.
- Created a Dockerfile using a base image like python:3.11-slim.
- Installed PyTorch inside the container and checked for MPS availability with:
import torch
print(torch.backends.mps.is_available())
This returns False
, meaning MPS is not detected inside the container.
- Running the same code outside Docker on macOS (bare metal), MPS is available (True).
My questions:
Does Docker on macOS support GPU passthrough for MPS acceleration?
Are there any specific Docker settings or configurations to enable GPU access inside the container?
If GPU passthrough is not supported, are there any workarounds to use MPS with PyTorch inside Docker?
Any guidance or workarounds would be greatly appreciated. Thanks!
本文标签: pythonHow to enable MPS acceleration for PyTorch inside Docker on MacStack Overflow
版权声明:本文标题:python - How to enable MPS acceleration for PyTorch inside Docker on Mac? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744031776a2579042.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论