Skip to content

Commit

Permalink
add gpu number
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Mar 1, 2024
1 parent 62006f6 commit 7bd0df6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions route/v1/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"strings"
"time"

"github.com/IceWhaleTech/CasaOS-Common/external"
"github.com/IceWhaleTech/CasaOS-Common/utils/common_err"
"github.com/IceWhaleTech/CasaOS-Common/utils/jwt"
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
Expand Down Expand Up @@ -818,6 +819,11 @@ func GetUserStatus(c *gin.Context) {
data["key"] = key
data["initialized"] = false
}
gpus, err := external.NvidiaGPUInfoList()
if err != nil {
logger.Error("NvidiaGPUInfoList error", zap.Error(err))
}
data["gpus"] = len(gpus)
c.JSON(common_err.SUCCESS,
model.Result{
Success: common_err.SUCCESS,
Expand Down

0 comments on commit 7bd0df6

Please # to comment.