prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  </issue>
  <code>
  [start of lutris/util/vulkan.py]
  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 of lutris/util/vulkan.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
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"}]}