Support multiple GPUs

This commit is contained in:
2026-05-02 12:24:53 +10:00
parent 8359511895
commit cff2a90fad
7 changed files with 135 additions and 28 deletions
@@ -35,6 +35,14 @@ namespace ANSCENTER {
[[nodiscard]] std::string GetProjectDirectory() { return _projectDirectory; }
[[nodiscard]] bool ZipExperiment(std::string projectName, int experimentNumber);
[[nodiscard]] bool IsProcessRunning(const char* processName);
// Detect NVIDIA GPUs via nvidia-smi. Returns false if no NVIDIA GPU is present
// (or nvidia-smi is unavailable). On success, populates deviceList with a yolo
// CLI-compatible token, e.g. "device=0", "device=0,1", "device=0,1,2,3,4,5".
[[nodiscard]] bool GetDeviceList(std::string& deviceList);
// Yolo-CLI-ready device argument with a leading space, suitable for direct
// concatenation into a yolo command line. Returns " device=0,1,..." when GPUs
// are detected, or " device=-1" as a fallback when none are.
[[nodiscard]] std::string GetDeviceArgOrDefault();
[[nodiscard]] double ParseObjectDetectionMAP(std::string stEvaluationResult);
[[nodiscard]] std::string GetLatestValidFolderAndDeleteOthers(const std::string& projectName, const std::string& rootPath);
protected: