def test_multi_gpu_none_backend(tmp_path):
    """Make sure when using multiple GPUs the user can't use `accelerator = None`."""
    seed_everything(42)
    trainer_options = {
        "default_root_dir": tmp_path,
        "enable_progress_bar": False,
        "max_epochs": 1,
        "limit_train_batches": 0.2,
        "limit_val_batches": 0.2,
        "accelerator": "gpu",
        "strategy": "ddp_spawn",
        "devices": 2,
    }

    dm = ClassifDataModule()
    model = ClassificationModel()
    tpipes.run_model_test(trainer_options, model, dm)
Make sure when using multiple GPUs the user can't use `accelerator = None`.
tests/tests_pytorch/models/test_gpu.py