diff --git a/CHANGELOG.md b/CHANGELOG.md
index f737f52..198f6cc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
+| 4.34.1 | 2020-01-05 | `graphics()` nvidia-smi detection improved |
| 4.34.0 | 2020-01-05 | `system()` added flag virtual |
| 4.33.8 | 2020-01-04 | `virtualBox()` fix issue windows host |
| 4.33.7 | 2020-01-04 | `graphics()` nvidia-smi detection improved |
diff --git a/README.md b/README.md
index 7b27ae5..972790a 100644
--- a/README.md
+++ b/README.md
@@ -829,7 +829,8 @@ Written by Sebastian Hildebrandt [sebhildebrandt](https://github.com/sebhildebra
- Nathan Patten [nrpatten](https://github.com/nrpatten)
- Juan Campuzano [juancampuzano](https://github.com/juancampuzano)
- Ricardo Polo [ricardopolo](https://github.com/ricardopolo)
-- Miłosz Dźwigała [mily20001]https://github.com/mily20001
+- Miłosz Dźwigała [mily20001](https://github.com/mily20001)
+- cconley717 [cconley717](https://github.com/cconley717)
OSX Temperature: credits here are going to:
diff --git a/docs/contributors.html b/docs/contributors.html
index b63c5dc..2d8ba73 100644
--- a/docs/contributors.html
+++ b/docs/contributors.html
@@ -61,6 +61,7 @@
Juan Campuzano juancampuzano
Ricardo Polo ricardopolo
Miłosz Dźwigała mily20001
+ cconley717 cconley717
OSX Temperature: credits here are going to:
diff --git a/docs/history.html b/docs/history.html
index 6f4bfdc..f2421e4 100644
--- a/docs/history.html
+++ b/docs/history.html
@@ -83,6 +83,11 @@
+
+ | 4.34.1 |
+ 2020-01-05 |
+ graphics() nvidia-smi detection improved |
+
| 4.34.0 |
2020-01-05 |
diff --git a/docs/index.html b/docs/index.html
index c2ab0b8..2b714bf 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -169,7 +169,7 @@
systeminformation
- Current Version: 4.34.0
+ Current Version: 4.34.1
diff --git a/lib/graphics.js b/lib/graphics.js
index 8363268..3cfdb48 100644
--- a/lib/graphics.js
+++ b/lib/graphics.js
@@ -784,7 +784,24 @@ function graphics(callback) {
result.controllers = parseLinesWindowsControllers(csections);
// needs to be rewritten ... using no spread operators
result.controllers = result.controllers.map((controller) => { // match by subDeviceId
- return mergeControllerNvidia(controller, nvidiaData.find(device => controller.subDeviceId.toLowerCase() === device.subDeviceId.split('x')[1].toLowerCase()) || {});
+ if (controller.vendor.toLowerCase() === 'nvidia') {
+ return mergeControllerNvidia(controller, nvidiaData.find(device => {
+ let windowsSubDeviceId = controller.subDeviceId.toLowerCase();
+ const nvidiaSubDeviceIdParts = device.subDeviceId.split('x');
+ let nvidiaSubDeviceId = nvidiaSubDeviceIdParts.length > 1 ? nvidiaSubDeviceIdParts[1].toLowerCase() : nvidiaSubDeviceIdParts[0].toLowerCase();
+ const lengthDifference = Math.abs(windowsSubDeviceId.length - nvidiaSubDeviceId.length);
+ if (windowsSubDeviceId.length > nvidiaSubDeviceId.length) {
+ for (let i = 0; i < lengthDifference; i++) {
+ nvidiaSubDeviceId = '0' + nvidiaSubDeviceId;
+ }
+ } else if (windowsSubDeviceId.length < nvidiaSubDeviceId.length) {
+ for (let i = 0; i < lengthDifference; i++) {
+ windowsSubDeviceId = '0' + windowsSubDeviceId;
+ }
+ }
+ return windowsSubDeviceId === nvidiaSubDeviceId;
+ }) || {});
+ }
});
// displays
let dsections = data[1].split(/\n\s*\n/);