diff --git a/java/src/main/java/ai/onnxruntime/OnnxRuntime.java b/java/src/main/java/ai/onnxruntime/OnnxRuntime.java index 0060773b4d..dc80666aac 100644 --- a/java/src/main/java/ai/onnxruntime/OnnxRuntime.java +++ b/java/src/main/java/ai/onnxruntime/OnnxRuntime.java @@ -219,6 +219,9 @@ final class OnnxRuntime { logger.log(Level.FINE, "Extracted native library '" + library + "' from resource path"); } } + } catch(Exception e) { + if(systemLoad) // We only throw if we're loading the library, otherwise failure is okay + throw e; } finally { cleanUp(tempFile, !systemLoad); } diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index dd9cb00ad2..b94614bca0 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -492,7 +492,7 @@ static AllocatorPtr GetCudaAllocator(OrtDevice::DeviceId id) { if (id_to_allocator_map->find(id) == id_to_allocator_map->end()) { // TODO: Expose knobs so that users can set fields associated with OrtArenaCfg so that we can pass it to the following method - id_to_allocator_map->insert({id, GetProviderInfo_CUDA()->CreateCudaAllocator(id, gpu_mem_limit, arena_extend_strategy, external_allocator_info)}); + id_to_allocator_map->insert({id, GetProviderInfo_CUDA()->CreateCudaAllocator(id, gpu_mem_limit, arena_extend_strategy, external_allocator_info, nullptr)}); } return (*id_to_allocator_map)[id]; @@ -2155,4 +2155,3 @@ onnxruntime::Environment& GetEnv() { } // namespace python } // namespace onnxruntime -