...
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user