MAC OS - PyTorch on Mac OS with GPU support
References
Enabling GPU on Mac OS for PyTorch
- Since I personally reinstalled GPU-supported PyTorch based on Anaconda, you can check whether Conda is installed by using the command
conda --version
. If it is installed, the output should confirm its presence. If not, you can download it from the Anaconda official website. - (Optional) If you want to create a separate environment specifically for Python with GPU support, you can use the following command:
1 | # Create an environment named 'torch-gpu' using Python version 3.10.9 |
-
According to the PyTorch official website, choose the corresponding version and copy the installation command.
-
You can use a simple Python script to verify MPS (Multi-Process Service) support:
1 | import torch |
It’s important to note that if you’re using MPS on macOS, you should specify it as follows: device = torch.device("mps)
.
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment