diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index 7ce4b2eb9..c82a64795 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -1853,8 +1853,9 @@ class SlicerPlugin(OctoPrintPlugin): The human readable name of the slicer. This will be displayed to the user during slicer selection. same_device True if the slicer runs on the same device as OctoPrint, False otherwise. Slicers running on the same - device will not be allowed to slice while a print is running due to performance reasons. Slice requests - against slicers running on the same device will result in an error. + device will not be allowed to slice on systems with less than two CPU cores (or an unknown number) while a + print is running due to performance reasons. Slice requests against slicers running on the same device and + less than two cores will result in an error. progress_report ``True`` if the slicer can report back slicing progress to OctoPrint ``False`` otherwise. source_file_types diff --git a/src/octoprint/server/api/files.py b/src/octoprint/server/api/files.py index e7916f1ed..077f8329b 100644 --- a/src/octoprint/server/api/files.py +++ b/src/octoprint/server/api/files.py @@ -544,9 +544,10 @@ def gcodeFileCommand(filename, target): if not any([octoprint.filemanager.valid_file_type(filename, type=source_file_type) for source_file_type in slicer_instance.get_slicer_properties().get("source_file_types", ["model"])]): return make_response("Cannot slice {filename}, not a model file".format(**locals()), 415) - if slicer_instance.get_slicer_properties().get("same_device", True) and (printer.is_printing() or printer.is_paused()): + cores = psutil.cpu_count() + if slicer_instance.get_slicer_properties().get("same_device", True) and (printer.is_printing() or printer.is_paused()) and (cores is None or cores < 2): # slicer runs on same device as OctoPrint, slicing while printing is hence disabled - return make_response("Cannot slice on {slicer} while printing due to performance reasons".format(**locals()), 409) + return make_response("Cannot slice on {slicer} while printing on single core systems or systems of unknown core count due to performance reasons".format(**locals()), 409) if "destination" in data and data["destination"]: destination = data["destination"]