Fix setting GPU behaviour:

Condition	maxSlotsPerGpu	Behavior
OptimizeModelStr	0	Bypass: non-shared temporary engine
1 GPU	1	Single slot, no round-robin
>1 GPU, VRAM < 24 GB	1	Round-robin: 1 slot per GPU
>1 GPU, VRAM >= 24 GB	-1	Elastic: on-demand slot growth
This commit is contained in:
2026-03-30 09:59:09 +11:00
parent 01eabf76bd
commit c1b919ec47
9 changed files with 123 additions and 6 deletions

View File

@@ -757,6 +757,7 @@ namespace ANSCENTER {
else {
_detector = std::make_unique<ANSOVFD>();
}
_detector->SetMaxSlotsPerGpu(m_maxSlotsPerGpu);
// LOCK DURING INITIALIZATION
bool initSuccess;
@@ -796,6 +797,7 @@ namespace ANSCENTER {
try {
// Create recognizer instance
_recognizer = std::make_unique<ANSFaceRecognizer>();
_recognizer->SetMaxSlotsPerGpu(m_maxSlotsPerGpu);
// Configure model
ModelConfig recognizerConfig;