Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding GPU information (model) in Node.js

In Node.js, we can easily use os module (documentation) in order to obtain CPU information:

    os.cpus()[0].model; // → Example: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz'

I'm looking for a similar way to obtain GPU model and if possible, specifications.

Thanks from ahead for any help!

like image 972
Selfish Avatar asked Sep 01 '26 17:09

Selfish


1 Answers

You can write a module switching the os.platform(), then execute a command for each os to grab the GPU info, as follows:

// Mac OS:
system_profiler | grep GeForce

// Windows:
wmic path win32_VideoController get name

// Linux:
sudo lshw -C display
like image 168
YarGnawh Avatar answered Sep 03 '26 09:09

YarGnawh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!