mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Specify all capabilities in TestGPUCheckpointRestore.
This test was broken by 5e6589e0b7 ("Update CUDA test compatibility to keep
up with added gVisor support.") which requires all
images/gpu/cuda-tests/run_sample.go users to specify "all" driver capabilities.
PiperOrigin-RevId: 713170590
This commit is contained in:
@@ -41,13 +41,12 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
// AllGPUCapabilities is the environment variable that enables all NVIDIA
|
||||
// AllGPUCapabilitiesEnv is the environment variable that enables all NVIDIA
|
||||
// GPU capabilities within a container.
|
||||
AllGPUCapabilities = "NVIDIA_DRIVER_CAPABILITIES=all"
|
||||
AllGPUCapabilitiesEnv = "NVIDIA_DRIVER_CAPABILITIES=all"
|
||||
|
||||
// DefaultGPUCapabilities is the environment variable that enables default
|
||||
// NVIDIA GPU capabilities within a container.
|
||||
DefaultGPUCapabilities = "NVIDIA_DRIVER_CAPABILITIES=compute,utility"
|
||||
// DefaultGPUCapabilities are the driver capabilities enabled by default.
|
||||
DefaultGPUCapabilities = "compute,utility"
|
||||
)
|
||||
|
||||
// GPURunOpts returns Docker run options with GPU support enabled.
|
||||
@@ -79,7 +78,7 @@ func GPURunOpts(sniffGPUOpts SniffGPUOpts) (RunOpts, error) {
|
||||
ReadOnly: true,
|
||||
})
|
||||
}
|
||||
gpuEnv := []string{sniffGPUOpts.GPUCapabilities()}
|
||||
gpuEnv := []string{"NVIDIA_DRIVER_CAPABILITIES=" + sniffGPUOpts.GPUCapabilities()}
|
||||
|
||||
if !*setCOSGPU {
|
||||
return RunOpts{
|
||||
|
||||
@@ -433,7 +433,7 @@ func (*FullyCompatible) IsExpectedFailure(ctx context.Context, env *TestEnvironm
|
||||
// getContainerOpts returns the container run options to run CUDA tests.
|
||||
func getContainerOpts() (dockerutil.RunOpts, error) {
|
||||
opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{
|
||||
Capabilities: dockerutil.AllGPUCapabilities,
|
||||
Capabilities: "all",
|
||||
})
|
||||
if err != nil {
|
||||
return dockerutil.RunOpts{}, fmt.Errorf("failed to get GPU run options: %w", err)
|
||||
@@ -885,7 +885,7 @@ func TestCUDA(t *testing.T) {
|
||||
t.Errorf(
|
||||
" $ docker run --runtime=%s --gpus=all -e %s --rm %s /run_sample %s",
|
||||
dockerutil.Runtime(),
|
||||
dockerutil.AllGPUCapabilities,
|
||||
dockerutil.AllGPUCapabilitiesEnv,
|
||||
runOpts.Image,
|
||||
failedTests[0],
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@ func TestFffmpegEncodeGPU(t *testing.T) {
|
||||
container := dockerutil.MakeContainer(ctx, t)
|
||||
defer container.CleanUp(ctx)
|
||||
opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{
|
||||
Capabilities: "NVIDIA_DRIVER_CAPABILITIES=video",
|
||||
Capabilities: "video",
|
||||
AllowIncompatibleIoctl: true, // TODO(gvisor.dev/issue/9452): Remove once supported in gVisor.
|
||||
})
|
||||
if err != nil {
|
||||
@@ -60,7 +60,7 @@ func TestFffmpegDecodeGPU(t *testing.T) {
|
||||
container := dockerutil.MakeContainer(ctx, t)
|
||||
defer container.CleanUp(ctx)
|
||||
opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{
|
||||
Capabilities: "NVIDIA_DRIVER_CAPABILITIES=video",
|
||||
Capabilities: "video",
|
||||
AllowIncompatibleIoctl: true, // TODO(gvisor.dev/issue/9452): Remove once supported in gVisor.
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -28,7 +28,7 @@ func TestGPUHello(t *testing.T) {
|
||||
defer c.CleanUp(ctx)
|
||||
|
||||
opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{
|
||||
Capabilities: dockerutil.AllGPUCapabilities,
|
||||
Capabilities: "all",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get GPU run options: %v", err)
|
||||
|
||||
+3
-1
@@ -35,7 +35,9 @@ func TestGPUCheckpointRestore(t *testing.T) {
|
||||
c := dockerutil.MakeContainer(ctx, t)
|
||||
defer c.CleanUp(ctx)
|
||||
|
||||
opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{})
|
||||
opts, err := dockerutil.GPURunOpts(dockerutil.SniffGPUOpts{
|
||||
Capabilities: "all",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get GPU run options: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user