M1 MAX: GPU available, but not used

Dear all,
I am trying to train scvi model (macOS, M1 MAX, scvi-tools (0.20.3)). GPU is available, but not used.

and the command:

model.train(use_gpu=True)

gives:
MisconfigurationException: MPSAccelerator can not run on your system since the accelerator is not available. The following accelerator(s) is available and can be passed into accelerator argument of Trainer: [‘cpu’].

import torch
import math
print(torch.backends.mps.is_available()) ----> True
print(torch.backends.mps.is_built()). ----> True

How to activate GPU and make use of it? Can anybody help me to solve this issue?

Thank you.

Hi, what kind of environment are you running this in? I would recommend using a conda version that is native for Mac M1 Miniconda — conda documentation

I should add that currently, even if MPS was working, most scvi-tools models will not work as there is no MPS implementation of the lgamma function.

The only one I’ve tested that works is peakVI.

1 Like

Thank you Adam for your answer!!
Anyway, I am very grateful for the tool and that it is working on M1 MAX on cpu now.

I am running it in miniforge3 (arm64).