diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp
index 26c1923..09811a0 100644
--- a/vulkan/libvulkan/driver.cpp
+++ b/vulkan/libvulkan/driver.cpp
@@ -17,13 +17,52 @@
 #include <sys/prctl.h>
 
 #include "driver.h"
+#include "loader.h"
 
 namespace vulkan {
 namespace driver {
 
+namespace {
+
+hwvulkan_device_t* g_hwdevice = nullptr;
+
+}  // anonymous namespace
+
 bool Debuggable() {
     return (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) >= 0);
 }
 
+bool OpenHAL() {
+    if (g_hwdevice)
+        return true;
+
+    const hwvulkan_module_t* module;
+    int result =
+        hw_get_module("vulkan", reinterpret_cast<const hw_module_t**>(&module));
+    if (result != 0) {
+        ALOGE("failed to load vulkan hal: %s (%d)", strerror(-result), result);
+        return false;
+    }
+
+    hwvulkan_device_t* device;
+    result =
+        module->common.methods->open(&module->common, HWVULKAN_DEVICE_0,
+                                     reinterpret_cast<hw_device_t**>(&device));
+    if (result != 0) {
+        ALOGE("failed to open vulkan driver: %s (%d)", strerror(-result),
+              result);
+        return false;
+    }
+
+    if (!InitLoader(device)) {
+        device->common.close(&device->common);
+        return false;
+    }
+
+    g_hwdevice = device;
+
+    return true;
+}
+
 }  // namespace driver
 }  // namespace vulkan
diff --git a/vulkan/libvulkan/loader.cpp b/vulkan/libvulkan/loader.cpp
index 9a3a3f8..2c63b06 100644
--- a/vulkan/libvulkan/loader.cpp
+++ b/vulkan/libvulkan/loader.cpp
@@ -178,34 +178,14 @@
 hwvulkan_device_t* g_hwdevice = nullptr;
 InstanceExtensionSet g_driver_instance_extensions;
 
-void LoadVulkanHAL() {
-    static const hwvulkan_module_t* module;
-    int result =
-        hw_get_module("vulkan", reinterpret_cast<const hw_module_t**>(&module));
-    if (result != 0) {
-        ALOGE("failed to load vulkan hal: %s (%d)", strerror(-result), result);
-        return;
-    }
-    result = module->common.methods->open(
-        &module->common, HWVULKAN_DEVICE_0,
-        reinterpret_cast<hw_device_t**>(&g_hwdevice));
-    if (result != 0) {
-        ALOGE("failed to open vulkan driver: %s (%d)", strerror(-result),
-              result);
-        module = nullptr;
-        return;
-    }
-
+bool LoadVulkanHAL() {
     VkResult vkresult;
     uint32_t count;
     if ((vkresult = g_hwdevice->EnumerateInstanceExtensionProperties(
              nullptr, &count, nullptr)) != VK_SUCCESS) {
         ALOGE("driver EnumerateInstanceExtensionProperties failed: %d",
               vkresult);
-        g_hwdevice->common.close(&g_hwdevice->common);
-        g_hwdevice = nullptr;
-        module = nullptr;
-        return;
+        return false;
     }
     VkExtensionProperties* extensions = static_cast<VkExtensionProperties*>(
         alloca(count * sizeof(VkExtensionProperties)));
@@ -213,10 +193,7 @@
              nullptr, &count, extensions)) != VK_SUCCESS) {
         ALOGE("driver EnumerateInstanceExtensionProperties failed: %d",
               vkresult);
-        g_hwdevice->common.close(&g_hwdevice->common);
-        g_hwdevice = nullptr;
-        module = nullptr;
-        return;
+        return false;
     }
     ALOGV_IF(count > 0, "Driver-supported instance extensions:");
     for (uint32_t i = 0; i < count; i++) {
@@ -230,6 +207,8 @@
     // Ignore driver attempts to support loader extensions
     g_driver_instance_extensions.reset(kKHR_surface);
     g_driver_instance_extensions.reset(kKHR_android_surface);
+
+    return true;
 }
 
 // -----------------------------------------------------------------------------
@@ -986,15 +965,18 @@
     return GetDispatchParent(instance).debug_report_callbacks;
 }
 
-namespace driver {
-
-bool OpenHAL() {
-    if (!g_hwdevice)
-        LoadVulkanHAL();
+bool InitLoader(hwvulkan_device_t* dev) {
+    if (!g_hwdevice) {
+        g_hwdevice = dev;
+        if (!LoadVulkanHAL())
+            g_hwdevice = nullptr;
+    }
 
     return (g_hwdevice != nullptr);
 }
 
+namespace driver {
+
 const VkAllocationCallbacks& GetDefaultAllocator() {
     return kDefaultAllocCallbacks;
 }
diff --git a/vulkan/libvulkan/loader.h b/vulkan/libvulkan/loader.h
index 0ec08b2..255b6c5 100644
--- a/vulkan/libvulkan/loader.h
+++ b/vulkan/libvulkan/loader.h
@@ -21,6 +21,8 @@
 #include "dispatch_gen.h"
 #include "debug_report.h"
 
+struct hwvulkan_device_t;
+
 namespace vulkan {
 
 enum InstanceExtension {
@@ -50,6 +52,8 @@
 // -----------------------------------------------------------------------------
 // loader.cpp
 
+bool InitLoader(hwvulkan_device_t* dev);
+
 // clang-format off
 VKAPI_ATTR VkResult CreateInstance_Bottom(const VkInstanceCreateInfo* create_info, const VkAllocationCallbacks* allocator, VkInstance* vkinstance);
 VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr_Bottom(VkInstance, const char* name);
