prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  latest version 0.4.21 thinks i don't have a vulkan loader
  Got the new message pop up to say I don't have a Vulkan loader installed. This is on an Ubuntu 18.10 fresh upgrade.
  
  I do:
  
  > liam@liam-main:~$ sudo apt install libvulkan1 libvulkan1:i386 
  [sudo] password for liam: 
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  libvulkan1 is already the newest version (1.1.82.0-0ubuntu1).
  libvulkan1:i386 is already the newest version (1.1.82.0-0ubuntu1).
  0 to upgrade, 0 to newly install, 0 to remove and 5 not to upgrade.
  
  Need more details? Let me know.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `lutris/util/vulkan.py`
  Content:
  ```
  1 """Vulkan helper module"""
  2 import os
  3 import re
  4 from enum import Enum
  5 
  6 class vulkan_available(Enum):
  7     NONE = 0
  8     THIRTY_TWO = 1
  9     SIXTY_FOUR = 2
  10     ALL = 3
  11 
  12 def search_for_file(directory):
  13     if os.path.isdir(directory):
  14         pattern = re.compile(r'^libvulkan\.so')
  15         files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))]
  16         files = [os.path.join(directory, f) for f in files if pattern.search(f)]
  17         if files:
  18             return True
  19     return False
  20 
  21 def vulkan_check():
  22     vulkan_lib = search_for_file("/usr/lib")
  23     vulkan_lib32 = search_for_file("/usr/lib32")
  24     vulkan_lib_multi = search_for_file("/usr/lib/x86_64-linux-gnu")
  25     vulkan_lib32_multi =  search_for_file("/usr/lib32/i386-linux-gnu")
  26     has_32_bit = vulkan_lib32 or vulkan_lib32_multi
  27     has_64_bit = vulkan_lib or vulkan_lib_multi
  28 
  29     if not (has_64_bit or has_32_bit):
  30         return vulkan_available.NONE
  31     if has_64_bit and not has_32_bit:
  32         return vulkan_available.SIXTY_FOUR
  33     if not has_64_bit and has_32_bit:
  34         return vulkan_available.THIRTY_TWO
  35     return vulkan_available.ALL
  36
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/lutris/util/vulkan.py b/lutris/util/vulkan.py
  --- a/lutris/util/vulkan.py
  +++ b/lutris/util/vulkan.py
  @@ -1,6 +1,7 @@
   """Vulkan helper module"""
   import os
   import re
  +import subprocess
   from enum import Enum
   
   class vulkan_available(Enum):
  @@ -9,22 +10,16 @@
       SIXTY_FOUR = 2
       ALL = 3
   
  -def search_for_file(directory):
  -    if os.path.isdir(directory):
  -        pattern = re.compile(r'^libvulkan\.so')
  -        files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))]
  -        files = [os.path.join(directory, f) for f in files if pattern.search(f)]
  -        if files:
  -            return True
  -    return False
  -
   def vulkan_check():
  -    vulkan_lib = search_for_file("/usr/lib")
  -    vulkan_lib32 = search_for_file("/usr/lib32")
  -    vulkan_lib_multi = search_for_file("/usr/lib/x86_64-linux-gnu")
  -    vulkan_lib32_multi =  search_for_file("/usr/lib32/i386-linux-gnu")
  -    has_32_bit = vulkan_lib32 or vulkan_lib32_multi
  -    has_64_bit = vulkan_lib or vulkan_lib_multi
  +    has_64_bit = False
  +    has_32_bit = False
  +    for line in subprocess.check_output(["ldconfig", "-p"]).splitlines():
  +        line = str(line)
  +        if 'libvulkan' in line:
  +            if 'x86-64' in line:
  +                has_64_bit = True
  +            else:
  +                has_32_bit = True
   
       if not (has_64_bit or has_32_bit):
           return vulkan_available.NONE
  
verification_info: {"golden_diff": "diff --git a/lutris/util/vulkan.py b/lutris/util/vulkan.py\n--- a/lutris/util/vulkan.py\n+++ b/lutris/util/vulkan.py\n@@ -1,6 +1,7 @@\n \"\"\"Vulkan helper module\"\"\"\n import os\n import re\n+import subprocess\n from enum import Enum\n \n class vulkan_available(Enum):\n@@ -9,22 +10,16 @@\n     SIXTY_FOUR = 2\n     ALL = 3\n \n-def search_for_file(directory):\n-    if os.path.isdir(directory):\n-        pattern = re.compile(r'^libvulkan\\.so')\n-        files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))]\n-        files = [os.path.join(directory, f) for f in files if pattern.search(f)]\n-        if files:\n-            return True\n-    return False\n-\n def vulkan_check():\n-    vulkan_lib = search_for_file(\"/usr/lib\")\n-    vulkan_lib32 = search_for_file(\"/usr/lib32\")\n-    vulkan_lib_multi = search_for_file(\"/usr/lib/x86_64-linux-gnu\")\n-    vulkan_lib32_multi =  search_for_file(\"/usr/lib32/i386-linux-gnu\")\n-    has_32_bit = vulkan_lib32 or vulkan_lib32_multi\n-    has_64_bit = vulkan_lib or vulkan_lib_multi\n+    has_64_bit = False\n+    has_32_bit = False\n+    for line in subprocess.check_output([\"ldconfig\", \"-p\"]).splitlines():\n+        line = str(line)\n+        if 'libvulkan' in line:\n+            if 'x86-64' in line:\n+                has_64_bit = True\n+            else:\n+                has_32_bit = True\n \n     if not (has_64_bit or has_32_bit):\n         return vulkan_available.NONE\n", "issue": "latest version 0.4.21 thinks i don't have a vulkan loader\nGot the new message pop up to say I don't have a Vulkan loader installed. This is on an Ubuntu 18.10 fresh upgrade.\r\n\r\nI do:\r\n\r\n> liam@liam-main:~$ sudo apt install libvulkan1 libvulkan1:i386 \r\n[sudo] password for liam: \r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nlibvulkan1 is already the newest version (1.1.82.0-0ubuntu1).\r\nlibvulkan1:i386 is already the newest version (1.1.82.0-0ubuntu1).\r\n0 to upgrade, 0 to newly install, 0 to remove and 5 not to upgrade.\r\n\r\nNeed more details? Let me know.\n", "before_files": [{"content": "\"\"\"Vulkan helper module\"\"\"\nimport os\nimport re\nfrom enum import Enum\n\nclass vulkan_available(Enum):\n    NONE = 0\n    THIRTY_TWO = 1\n    SIXTY_FOUR = 2\n    ALL = 3\n\ndef search_for_file(directory):\n    if os.path.isdir(directory):\n        pattern = re.compile(r'^libvulkan\\.so')\n        files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))]\n        files = [os.path.join(directory, f) for f in files if pattern.search(f)]\n        if files:\n            return True\n    return False\n\ndef vulkan_check():\n    vulkan_lib = search_for_file(\"/usr/lib\")\n    vulkan_lib32 = search_for_file(\"/usr/lib32\")\n    vulkan_lib_multi = search_for_file(\"/usr/lib/x86_64-linux-gnu\")\n    vulkan_lib32_multi =  search_for_file(\"/usr/lib32/i386-linux-gnu\")\n    has_32_bit = vulkan_lib32 or vulkan_lib32_multi\n    has_64_bit = vulkan_lib or vulkan_lib_multi\n\n    if not (has_64_bit or has_32_bit):\n        return vulkan_available.NONE\n    if has_64_bit and not has_32_bit:\n        return vulkan_available.SIXTY_FOUR\n    if not has_64_bit and has_32_bit:\n        return vulkan_available.THIRTY_TWO\n    return vulkan_available.ALL\n", "path": "lutris/util/vulkan.py"}], "after_files": [{"content": "\"\"\"Vulkan helper module\"\"\"\nimport os\nimport re\nimport subprocess\nfrom enum import Enum\n\nclass vulkan_available(Enum):\n    NONE = 0\n    THIRTY_TWO = 1\n    SIXTY_FOUR = 2\n    ALL = 3\n\ndef vulkan_check():\n    has_64_bit = False\n    has_32_bit = False\n    for line in subprocess.check_output([\"ldconfig\", \"-p\"]).splitlines():\n        line = str(line)\n        if 'libvulkan' in line:\n            if 'x86-64' in line:\n                has_64_bit = True\n            else:\n                has_32_bit = True\n\n    if not (has_64_bit or has_32_bit):\n        return vulkan_available.NONE\n    if has_64_bit and not has_32_bit:\n        return vulkan_available.SIXTY_FOUR\n    if not has_64_bit and has_32_bit:\n        return vulkan_available.THIRTY_TWO\n    return vulkan_available.ALL\n", "path": "lutris/util/vulkan.py"}]}