From c82bebde6a2b56fe9cf97de1d69e78ef96326535 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Sun, 23 Apr 2023 20:21:59 -0700 Subject: [PATCH] Fix the TestCUDAProviderOptions test error (#15649) The test limits GPU's running memory requirements to 20MB. It might be enough in the past, but it seems not enough now when we upgrade CUDA to a newer version or add more kernels/graph transformers to our code. Therefore we need to increase it. Our test log shows sometimes the model needs 128MB memory. So I set the limit to 256MB. --- .../InferenceTest.netcore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs index 4845bede61..1495bcc459 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs @@ -80,7 +80,8 @@ namespace Microsoft.ML.OnnxRuntime.Tests var providerOptionsDict = new Dictionary(); providerOptionsDict["device_id"] = "0"; - providerOptionsDict["gpu_mem_limit"] = "20971520"; + // 256MB + providerOptionsDict["gpu_mem_limit"] = "268435456"; providerOptionsDict["arena_extend_strategy"] = "kSameAsRequested"; providerOptionsDict["cudnn_conv_algo_search"] = "DEFAULT"; providerOptionsDict["do_copy_in_default_stream"] = "1"; @@ -96,7 +97,7 @@ namespace Microsoft.ML.OnnxRuntime.Tests value = resultProviderOptionsDict["device_id"]; Assert.Equal("0", value); value = resultProviderOptionsDict["gpu_mem_limit"]; - Assert.Equal("20971520", value); + Assert.Equal("268435456", value); value = resultProviderOptionsDict["arena_extend_strategy"]; Assert.Equal("kSameAsRequested", value); value = resultProviderOptionsDict["cudnn_conv_algo_search"];