diff --git a/arkindex/process/migrations/0037_workerrun_use_gpu.py b/arkindex/process/migrations/0037_workerrun_use_gpu.py index a8de2b3621db5981f98cb29ad2374c82732f63bb..35a769e410d547745244ebbfa7fffbd2d1111c20 100644 --- a/arkindex/process/migrations/0037_workerrun_use_gpu.py +++ b/arkindex/process/migrations/0037_workerrun_use_gpu.py @@ -8,9 +8,11 @@ from arkindex.process.models import FeatureUsage def migrate_gpu_usage(apps, schema): WorkerRun = apps.get_model("process", "WorkerRun") - WorkerRun.objects.filter( - version__gpu_usage__in=(FeatureUsage.Required, FeatureUsage.Supported), process__use_gpu=True - ).update(use_gpu=True) + # For versions that require GPUs, WorkerRuns should always use a GPU. + WorkerRun.objects.filter(version__gpu_usage=FeatureUsage.Required).update(use_gpu=True) + # For versions that support GPUs, only use a GPU on processes where GPU usage was enabled. + # This replicates the previous behavior with process-wide GPU usage. + WorkerRun.objects.filter(version__gpu_usage=FeatureUsage.Supported, process__use_gpu=True).update(use_gpu=True) def reverse(apps, schema): Process = apps.get_model("process", "Process")