Skip to content

Commit

Permalink
fix: add MPS fallback env var
Browse files Browse the repository at this point in the history
This was lost during the migration from legacy scripts to launcher.
  • Loading branch information
psychedelicious committed Dec 24, 2024
1 parent 95e02ca commit b5f530e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/invoke-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ export class InvokeManager {
env.INVOKEAI_HOST = '0.0.0.0';
}

// Some torch operations are not yet supported on MPS. This tells torch to use CPU for those operations.
// See: https://pytorch.org/docs/stable/mps_environment_variables.html
if (process.platform === 'darwin') {
env.PYTORCH_ENABLE_MPS_FALLBACK = '1';
}

const invokeProcess = execFile(dirDetails.invokeExecPath, [], { env });
this.process = invokeProcess;

Expand Down

0 comments on commit b5f530e

Please sign in to comment.