Skip to content

Commit bb895f3

Browse files
authored
Merge pull request #57 from docker/nvidia-runtime
standalone: use nvidia runtime if using GPU
2 parents 9183061 + 2154a34 commit bb895f3

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pkg/standalone/containers.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,8 @@ func CreateControllerContainer(ctx context.Context, dockerClient *client.Client,
7373
},
7474
}
7575
if gpu {
76-
hostConfig.Resources = container.Resources{
77-
DeviceRequests: []container.DeviceRequest{
78-
{
79-
Driver: "nvidia",
80-
Count: -1,
81-
Capabilities: [][]string{{"gpu"}},
82-
},
83-
},
84-
}
76+
hostConfig.Runtime = "nvidia"
77+
hostConfig.DeviceRequests = []container.DeviceRequest{{Count: -1, Capabilities: [][]string{{"gpu"}}}}
8578
}
8679

8780
// Create the container.

0 commit comments

Comments
 (0)