This commit is contained in:
2026-03-27 13:38:05 +09:00
parent f6bce36924
commit 0479d5777a
4 changed files with 104 additions and 24 deletions
+21
View File
@@ -0,0 +1,21 @@
package util
object HardwareDetector {
fun getCpuCores(): Int = Runtime.getRuntime().availableProcessors()
fun getTotalRamGb(): Long {
val bean = java.lang.management.ManagementFactory.getOperatingSystemMXBean()
as com.sun.management.OperatingSystemMXBean
return bean.totalMemorySize / (1024 * 1024 * 1024)
}
// Windows 환경에서 NVIDIA GPU 존재 여부 확인 (간이 로직)
fun hasNvidiaGpu(): Boolean {
return try {
val process = Runtime.getRuntime().exec("nvidia-smi")
process.waitFor() == 0
} catch (e: Exception) {
false
}
}
}