Skip to content

Commit

Permalink
print error message if sysfs read doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
hertg committed Sep 23, 2022
1 parent 0bbcba1 commit a1ec175
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pci/pci.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"

"github.com/fatih/color"
"github.com/hertg/egpu-switcher/internal/logger"
"github.com/hertg/gopci/pkg/pci"
)

Expand Down Expand Up @@ -93,6 +94,7 @@ func ReadGPUs() []*GPU {
}
devices, err := pci.Scan(gpuFilter)
if err != nil {
logger.Error("unable to read pci information from sysfs: %s", err)
panic("unable to read pci information from sysfs")
}
var gpus []*GPU
Expand Down

0 comments on commit a1ec175

Please sign in to comment.