diff --git a/runner/internal/shim/api/handlers.go b/runner/internal/shim/api/handlers.go index 1374fbd803..94eb485076 100644 --- a/runner/internal/shim/api/handlers.go +++ b/runner/internal/shim/api/handlers.go @@ -4,6 +4,7 @@ import ( "context" "errors" "net/http" + "reflect" "github.com/dstackai/dstack/runner/internal/api" "github.com/dstackai/dstack/runner/internal/log" @@ -24,7 +25,7 @@ func (s *ShimServer) HealthcheckHandler(w http.ResponseWriter, r *http.Request) func (s *ShimServer) InstanceHealthHandler(w http.ResponseWriter, r *http.Request) (interface{}, error) { ctx := r.Context() response := InstanceHealthResponse{} - if s.dcgmWrapper != nil { + if !reflect.ValueOf(s.dcgmWrapper).IsNil() { if dcgmHealth, err := s.dcgmWrapper.GetHealth(); err != nil { log.Error(ctx, "failed to get health from DCGM", "err", err) } else {