Skip to content

Commit

Permalink
Revert "updated error handling with NVIDIA drivers are not available"
Browse files Browse the repository at this point in the history
This reverts commit 9abb59f.
  • Loading branch information
Bianco95 committed Apr 22, 2024
1 parent 0729334 commit 0473644
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pkg/docker/gpustrategies/NvidiaHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type GPUManager struct {
GPUSpecsMutex sync.Mutex // Mutex to make GPUSpecsList access atomic
Vendor string
Ctx context.Context
NVMLstatus bool
}

type GPUManagerInterface interface {
Expand All @@ -50,21 +49,15 @@ func (a *GPUManager) Init() error {

ret := nvml.Init()
if ret != nvml.SUCCESS {
a.NVMLstatus = false
return fmt.Errorf("Unable to initialize NVML")
}
a.NVMLstatus = true

return nil
}

// Discover implements the Discover function of the GPUManager interface
func (a *GPUManager) Discover() error {

if !a.NVMLstatus {
return fmt.Errorf("NVML is not initialized")
}

log.G(a.Ctx).Info("Discovering GPUs...")

count, ret := nvml.DeviceGetCount()
Expand Down Expand Up @@ -112,10 +105,6 @@ func (a *GPUManager) Discover() error {

func (a *GPUManager) Check() error {

if !a.NVMLstatus {
return fmt.Errorf("NVML is not initialized")
}

log.G(a.Ctx).Info("Checking the availability of GPUs...")

cli, err := client.NewEnvClient()
Expand Down Expand Up @@ -170,10 +159,6 @@ func (a *GPUManager) Check() error {

func (a *GPUManager) Shutdown() error {

if !a.NVMLstatus {
return fmt.Errorf("NVML is not initialized")
}

log.G(a.Ctx).Info("Shutting down NVML...")

ret := nvml.Shutdown()
Expand Down

0 comments on commit 0473644

Please sign in to comment.