<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - libvulkan_radeon crashes if loaded on Intel hardware"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=102010">102010</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>libvulkan_radeon crashes if loaded on Intel hardware
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>17.1
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/Vulkan/radeon
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>thiago@kde.org
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When I run vulkaninfo, it crashes:

===========
VULKAN INFO
===========

Vulkan API Version: 1.0.41

INFO: [loader] Code 0 : Found manifest file
/etc/vulkan/explicit_layer.d/VkLayer_core_validation.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/etc/vulkan/explicit_layer.d/VkLayer_object_tracker.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/etc/vulkan/explicit_layer.d/VkLayer_parameter_validation.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/etc/vulkan/explicit_layer.d/VkLayer_swapchain.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/etc/vulkan/explicit_layer.d/VkLayer_threading.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/etc/vulkan/explicit_layer.d/VkLayer_unique_objects.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/usr/share/vulkan/explicit_layer.d/VkLayer_core_validation.json, version
"1.0.0"
INFO: [loader] Code 0 : Found manifest file
/usr/share/vulkan/explicit_layer.d/VkLayer_object_tracker.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/usr/share/vulkan/explicit_layer.d/VkLayer_parameter_validation.json, version
"1.0.0"
INFO: [loader] Code 0 : Found manifest file
/usr/share/vulkan/explicit_layer.d/VkLayer_swapchain.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/usr/share/vulkan/explicit_layer.d/VkLayer_threading.json, version "1.0.0"
INFO: [loader] Code 0 : Found manifest file
/usr/share/vulkan/explicit_layer.d/VkLayer_unique_objects.json, version "1.0.0"
INFO: [loader] Code 0 : Found ICD manifest file
/usr/share/vulkan/icd.d/intel_icd.x86_64.json, version "1.0.0"
INFO: [loader] Code 0 : Found ICD manifest file
/usr/share/vulkan/icd.d/radeon_icd.x86_64.json, version "1.0.0"

Program received signal SIGSEGV, Segmentation fault.

The backtrace points to libvulkan loading the Radeon driver:

(gdb) bt
#0  0x000000000001f436 in ?? ()
#1  0x00007fffede683f2 in radv_lookup_entrypoint (name=<optimized out>) at
radv_entrypoints.c:833
#2  0x00007ffff797f3e9 in loader_scanned_icd_add (api_version=4194307, 
    filename=0x7fffffffd0a0 "/usr/lib64/libvulkan_radeon.so",
icd_tramp_list=0x5555557c2bb0, inst=0x5555557c2b70)
    at
/usr/src/debug/Vulkan-LoaderAndValidationLayers-1.0.41/loader/loader.c:1565
#3  loader_icd_scan (inst=inst@entry=0x5555557c2b70,
icd_tramp_list=icd_tramp_list@entry=0x5555557c2bb0)
    at
/usr/src/debug/Vulkan-LoaderAndValidationLayers-1.0.41/loader/loader.c:3177
#4  0x00007ffff798506b in vkCreateInstance (pCreateInfo=0x7fffffffd660,
pAllocator=0x0, pInstance=0x7fffffffd6b0)
    at
/usr/src/debug/Vulkan-LoaderAndValidationLayers-1.0.41/loader/trampoline.c:329
#5  0x00005555555558c2 in AppCreateInstance (inst=0x7fffffffd6b0)
    at
/usr/src/debug/Vulkan-LoaderAndValidationLayers-1.0.41/demos/vulkaninfo.c:667
#6  main (argc=<optimized out>, argv=<optimized out>)
    at
/usr/src/debug/Vulkan-LoaderAndValidationLayers-1.0.41/demos/vulkaninfo.c:1454

My system has an Intel GPU:

$ lspci -s 0:2
00:02.0 VGA compatible controller: Intel Corporation Iris Graphics 540 (rev 0a)

The Intel driver is installed:

$ ls -l /usr/lib64/libvulkan*
-rwxr-xr-x 1 root root 2625088 jul 24 04:26 /usr/lib64/libvulkan_intel.so
-rwxr-xr-x 1 root root 1655912 jul 24 04:26 /usr/lib64/libvulkan_radeon.so
lrwxrwxrwx 1 root root      19 mai 27 22:52 /usr/lib64/libvulkan.so.1 ->
libvulkan.so.1.0.41
-rwxr-xr-x 1 root root  239600 mai 27 22:52 /usr/lib64/libvulkan.so.1.0.41

Both files drivers are installed due to a dependency in package management, but
clearly the Radeon one should not be used. The driver should validate that it
is in the correct HW and bail out if not.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>