Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 33676f2

Browse files
committed
fix: guard nvidia available
1 parent b89168b commit 33676f2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

engine/services/hardware_service.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,13 @@ void HardwareService::UpdateHardwareInfos() {
279279
}
280280

281281
#if defined(_WIN32) || defined(_WIN64) || defined(__linux__)
282-
const char* value = std::getenv("CUDA_VISIBLE_DEVICES");
283-
if (value) {
284-
LOG_INFO << "CUDA_VISIBLE_DEVICES: " << value;
285-
} else {
286-
need_restart = true;
282+
if (system_info_utils::IsNvidiaSmiAvailable()) {
283+
const char* value = std::getenv("CUDA_VISIBLE_DEVICES");
284+
if (value) {
285+
LOG_INFO << "CUDA_VISIBLE_DEVICES: " << value;
286+
} else {
287+
need_restart = true;
288+
}
287289
}
288290
#endif
289291

0 commit comments

Comments
 (0)