-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b38fdd6
commit 464bef2
Showing
5 changed files
with
3,081 additions
and
749 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use strict"; | ||
|
||
const gpuInfo = require("gpu-info"); | ||
const logger = require("../utils/logger"); | ||
const platform = require("os").platform(); | ||
|
||
/** | ||
* Show GPU information | ||
* @async | ||
*/ | ||
async function gpuSpecs() { | ||
try { | ||
console.log(platform); | ||
const data = await gpuInfo(); | ||
logger.info(`GPU Information (GPU Count ${data.length})`); | ||
for (let i = 0; i < data.length; i++) { | ||
const gpu = data[i]; | ||
logger.info(i + 1); | ||
const info = { | ||
Status: gpu.Status, | ||
name: gpu.Name, | ||
"Max Refresh Rate": gpu.MaxRefreshRate, | ||
"Current Refresh Rate": gpu.CurrentRefreshRate, | ||
"GPU Size": (gpu.AdapterRAM / 1024 ** 3).toFixed(2) + " GB", | ||
"Video Processor": gpu.VideoProcessor, | ||
"Driver Version": gpu.DriverVersion, | ||
"Current Resolution": `${gpu.CurrentHorizontalResolution}x${gpu.CurrentVerticalResolution}`, | ||
}; | ||
console.table(info); | ||
} | ||
} catch (error) { | ||
logger.info(`GPU Information`); | ||
logger.error(error.message); | ||
} | ||
} | ||
|
||
module.exports = gpuSpecs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.