From 54fb723d23d351551b75d879198aafb1eac2dede Mon Sep 17 00:00:00 2001 From: Masahiro Masuda Date: Sat, 22 May 2021 12:52:18 +0900 Subject: [PATCH] Revert "[Bugfix][Vulkan] Call VulkanDeviceAPI destructor on program exit (#7997)" This reverts commit 58c3413a30e5b03208b6281651d38ee02c44f9c1. --- src/runtime/vulkan/vulkan.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/runtime/vulkan/vulkan.cc b/src/runtime/vulkan/vulkan.cc index 8982ea32648b..3c8b184e87c8 100644 --- a/src/runtime/vulkan/vulkan.cc +++ b/src/runtime/vulkan/vulkan.cc @@ -418,13 +418,8 @@ class VulkanDeviceAPI final : public DeviceAPI { } static VulkanDeviceAPI* Global() { - // Most of the TVM Global() functions allocate with "new" and do - // not deallocate, as the OS can clean up any leftover buffers at - // the end. In this case, we need the VulkanDeviceAPI destructor - // to call vkDestroyInstance, to prevent a segfault on exit when - // using some nvidia drivers. - static VulkanDeviceAPI inst; - return &inst; + static VulkanDeviceAPI* inst = new VulkanDeviceAPI(); + return inst; } const VulkanContext& context(size_t device_id) const {