From 63a73495438d621b8de24fa031a6af938bbf4ff4 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Mon, 29 Jan 2018 11:38:28 +0100 Subject: [PATCH] Disable AMDGPU GFX9/Vega on LLVM < 6.0.0. Upstream advertises support since LLVM 5.0.0, but it does not work properly: https://bugzilla.opensuse.org/show_bug.cgi?id=1075901 --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 13 ++++++++++--- src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) Index: mesa-17.3.3/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c =================================================================== --- mesa-17.3.3.orig/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ mesa-17.3.3/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -46,9 +46,16 @@ do_winsys_init(struct radv_amdgpu_winsys if (!ac_query_gpu_info(fd, ws->dev, &ws->info, &ws->amdinfo)) return false; - /* LLVM 5.0 is required for GFX9. */ - if (ws->info.chip_class >= GFX9 && HAVE_LLVM < 0x0500) { - fprintf(stderr, "amdgpu: LLVM 5.0 is required, got LLVM %i.%i\n", + /* LLVM 6.0 is required for GFX9. */ + /* + Upstream version of Mesa allows GFX9 since LLVM 5.0, but it does not work correctly: + https://bugzilla.opensuse.org/show_bug.cgi?id=1075901 + The issues are fixed in LLVM 6. We have decided to disable GFX9 support with LLVM 5 + and wait for LLVM 6. + -- Michal Srb msrb@suse.com, 2018-01-29 + */ + if (ws->info.chip_class >= GFX9 && HAVE_LLVM < 0x0600) { + fprintf(stderr, "amdgpu: LLVM 6.0 is required, got LLVM %i.%i\n", HAVE_LLVM >> 8, HAVE_LLVM & 255); return false; } Index: mesa-17.3.3/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c =================================================================== --- mesa-17.3.3.orig/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ mesa-17.3.3/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -58,9 +58,16 @@ static bool do_winsys_init(struct amdgpu if (!ac_query_gpu_info(fd, ws->dev, &ws->info, &ws->amdinfo)) goto fail; - /* LLVM 5.0 is required for GFX9. */ - if (ws->info.chip_class >= GFX9 && HAVE_LLVM < 0x0500) { - fprintf(stderr, "amdgpu: LLVM 5.0 is required, got LLVM %i.%i\n", + /* LLVM 6.0 is required for GFX9. */ + /* + Upstream version of Mesa allows GFX9 since LLVM 5.0, but it does not work correctly: + https://bugzilla.opensuse.org/show_bug.cgi?id=1075901 + The issues are fixed in LLVM 6. We have decided to disable GFX9 support with LLVM 5 + and wait for LLVM 6. + -- Michal Srb msrb@suse.com, 2018-01-29 + */ + if (ws->info.chip_class >= GFX9 && HAVE_LLVM < 0x0600) { + fprintf(stderr, "amdgpu: LLVM 6.0 is required, got LLVM %i.%i\n", HAVE_LLVM >> 8, HAVE_LLVM & 255); goto fail; }