Skip to content

Commit

Permalink
Bug/add support for wsl2 (#1134)
Browse files Browse the repository at this point in the history
* Skip gpu check when run environment in WSL2

Signed-off-by: nullday <aseaday@hotmail.com>

* Fix order of check

Signed-off-by: nullday <aseaday@hotmail.com>

Signed-off-by: nullday <aseaday@hotmail.com>
  • Loading branch information
aseaday committed Nov 2, 2022
1 parent e9e22da commit bc1c513
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/envd/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,14 @@ func (e dockerEngine) GPUEnabled(ctx context.Context) (bool, error) {
}
logrus.WithField("info", info).Debug("docker info")
nv := info.Runtimes["nvidia"]
return nv.Path != "", nil
if nv.Path != "" {
return true, nil
} else if strings.HasSuffix(info.KernelVersion, "WSL2") {
logrus.Warn("We couldn't detect if your runtime support GPU on WSL2, we will continue to run your environment.")
return true, nil
} else {
return false, nil
}
}

func (e dockerEngine) GetImage(ctx context.Context, image string) (dockertypes.ImageSummary, error) {
Expand Down

0 comments on commit bc1c513

Please sign in to comment.