From 2df9ccc3ffa9ad57f82d3f0ca8502d58df4128fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20T=C3=A1mara?= Date: Sun, 29 Jun 2025 22:46:30 -0500 Subject: [PATCH] Allow to train even with no CPU available Fixes the error when the --accelerator cpu option was given, it's possible to train with only CPU too. with small batches and considerably amount of memory, and days allowing the train process to run. RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx --- src/python/piper_train/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/piper_train/__main__.py b/src/python/piper_train/__main__.py index 824c7cc6f..eb8f5872b 100644 --- a/src/python/piper_train/__main__.py +++ b/src/python/piper_train/__main__.py @@ -125,11 +125,13 @@ def main(): else: torch.manual_seed(args.seed) _LOGGER.debug("Using manual seed: %s", args.seed) - + # Function to check if the GPU supports Tensor Cores def supports_tensor_cores(): # Assuming that Tensor Cores are supported if the compute capability is 7.0 or higher # This is a simplification; you might need a more detailed check based on your specific requirements + if args.accelerator == "cpu": + return False return torch.cuda.get_device_capability(0)[0] >= 7 # Set the float32 matrix multiplication precision based on GPU support for Tensor Cores