mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Add extra check for GPU device info for null pointer (#3032)
* add check for GPU device info * add changelog note * change return to continue * Small refactor --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
@@ -2,17 +2,18 @@ package doctor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"slices"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/jaypipes/ghw"
|
||||
"github.com/pterm/pterm"
|
||||
"github.com/samber/lo"
|
||||
"github.com/wailsapp/wails/v3/internal/operatingsystem"
|
||||
"github.com/wailsapp/wails/v3/internal/version"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"slices"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func Run() (err error) {
|
||||
@@ -155,12 +156,12 @@ func Run() (err error) {
|
||||
// Probe GPU
|
||||
gpu, _ := ghw.GPU(ghw.WithDisableWarnings())
|
||||
if gpu != nil {
|
||||
prefix := "GPU"
|
||||
for idx, card := range gpu.GraphicsCards {
|
||||
if len(gpu.GraphicsCards) > 1 {
|
||||
prefix = "GPU " + strconv.Itoa(idx+1) + " "
|
||||
details := "Unknown"
|
||||
prefix := "GPU " + strconv.Itoa(idx+1)
|
||||
if card.DeviceInfo != nil {
|
||||
details = fmt.Sprintf("%s (%s) - Driver: %s ", card.DeviceInfo.Product.Name, card.DeviceInfo.Vendor.Name, card.DeviceInfo.Driver)
|
||||
}
|
||||
details := fmt.Sprintf("%s (%s) - Driver: %s", card.DeviceInfo.Product.Name, card.DeviceInfo.Vendor.Name, card.DeviceInfo.Driver)
|
||||
systemTabledata = append(systemTabledata, []string{prefix, details})
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
#### Fixed
|
||||
|
||||
- Fixed typo on docs/reference/options page. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/2887)
|
||||
- Fixed bug for linux in doctor in the event user doesn't have proper drivers installed. Added by [@pylotlight](https://github.com/pylotlight) in [PR](https://github.com/wailsapp/wails/pull/3032)
|
||||
|
||||
## v2.6.0 - 2023-09-06
|
||||
|
||||
|
||||
Reference in New Issue
Block a user