prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Vulkan check will not work on certain distributions
  Note that this probably won't work on certain distributions, where this file, for instance, is actually called `/usr/lib/x86_64-linux-gnu/libvulkan.so.1` or similar. Confirmed not working on Linux Mint 19.
  
  _Originally posted by @Vexatos in https://github.com/lutris/lutris/pull/1186_
  
  --- 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 from enum import Enum
  4 
  5 class vulkan_available(Enum):
  6     NONE = 0
  7     THIRTY_TWO = 1
  8     SIXTY_FOUR = 2
  9     ALL = 3
  10 
  11 def vulkan_check():
  12     vulkan_lib = os.path.isfile("/usr/lib/libvulkan.so")
  13     vulkan_lib32 = os.path.isfile("/usr/lib32/libvulkan.so")
  14     vulkan_lib_multi = os.path.isfile("/usr/lib/x86_64-linux-gnu/libvulkan.so")
  15     vulkan_lib32_multi = os.path.isfile("/usr/lib32/i386-linux-gnu/libvulkan.so")
  16     has_32_bit = vulkan_lib32 or vulkan_lib32_multi
  17     has_64_bit = vulkan_lib or vulkan_lib_multi
  18 
  19     if not (has_64_bit or has_32_bit):
  20         return vulkan_available.NONE
  21     if has_64_bit and not has_32_bit:
  22         return vulkan_available.SIXTY_FOUR
  23     if not has_64_bit and has_32_bit:
  24         return vulkan_available.THIRTY_TWO
  25     return vulkan_available.ALL
  26
  ```
  --- 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,5 +1,6 @@
   """Vulkan helper module"""
   import os
  +import re
   from enum import Enum
   
   class vulkan_available(Enum):
  @@ -8,11 +9,20 @@
       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 = os.path.isfile("/usr/lib/libvulkan.so")
  -    vulkan_lib32 = os.path.isfile("/usr/lib32/libvulkan.so")
  -    vulkan_lib_multi = os.path.isfile("/usr/lib/x86_64-linux-gnu/libvulkan.so")
  -    vulkan_lib32_multi = os.path.isfile("/usr/lib32/i386-linux-gnu/libvulkan.so")
  +    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
  
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,5 +1,6 @@\n \"\"\"Vulkan helper module\"\"\"\n import os\n+import re\n from enum import Enum\n \n class vulkan_available(Enum):\n@@ -8,11 +9,20 @@\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 = os.path.isfile(\"/usr/lib/libvulkan.so\")\n-    vulkan_lib32 = os.path.isfile(\"/usr/lib32/libvulkan.so\")\n-    vulkan_lib_multi = os.path.isfile(\"/usr/lib/x86_64-linux-gnu/libvulkan.so\")\n-    vulkan_lib32_multi = os.path.isfile(\"/usr/lib32/i386-linux-gnu/libvulkan.so\")\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", "issue": "Vulkan check will not work on certain distributions\nNote that this probably won't work on certain distributions, where this file, for instance, is actually called `/usr/lib/x86_64-linux-gnu/libvulkan.so.1` or similar. Confirmed not working on Linux Mint 19.\r\n\r\n_Originally posted by @Vexatos in https://github.com/lutris/lutris/pull/1186_\n", "before_files": [{"content": "\"\"\"Vulkan helper module\"\"\"\nimport os\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    vulkan_lib = os.path.isfile(\"/usr/lib/libvulkan.so\")\n    vulkan_lib32 = os.path.isfile(\"/usr/lib32/libvulkan.so\")\n    vulkan_lib_multi = os.path.isfile(\"/usr/lib/x86_64-linux-gnu/libvulkan.so\")\n    vulkan_lib32_multi = os.path.isfile(\"/usr/lib32/i386-linux-gnu/libvulkan.so\")\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\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"}]}