radv: enable ACO by default
authorDaniel Schürmann <daniel@schuermann.dev>
Thu, 19 Sep 2019 11:43:35 +0000 (13:43 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 25 Jun 2020 13:16:30 +0000 (15:16 +0200)
No more dragons have been seen, caution is still required...

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5445>

.gitlab-ci.yml
docs/envvars.rst
docs/relnotes/new_features.txt
src/amd/vulkan/radv_debug.h
src/amd/vulkan/radv_device.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h

index fd895e4..4b8713b 100644 (file)
@@ -1116,7 +1116,6 @@ arm64_a530_gles31:
   variables:
     VK_DRIVER: radeon
     ACO_DEBUG: validateir,validatera
-    RADV_PERFTEST: aco
 
 # Can only be triggered manually on personal branches because RADV is the only
 # driver that does Vulkan testing at the moment.
index bebc1e1..bc431cc 100644 (file)
@@ -575,8 +575,6 @@ RADV driver environment variables
 ``RADV_PERFTEST``
    a comma-separated list of named flags, which do various things:
 
-   ``aco``
-      enable ACO experimental compiler
    ``bolist``
       enable the global BO list
    ``cswave32``
index a0f3789..4260ad9 100644 (file)
@@ -12,3 +12,5 @@ VK_GOOGLE_user_type on ANV and RADV.
 VK_KHR_shader_subgroup_extended_types on RADV/ACO.
 GL_ARB_gl_spirv on nvc0/nir.
 GL_ARB_spirv_extensions on nvc0/nir.
+RADV now uses ACO per default as backend
+RADV_DEBUG=llvm option to enable LLVM backend for RADV
index 2935f6a..c755987 100644 (file)
@@ -70,7 +70,6 @@ enum {
        RADV_PERFTEST_PS_WAVE_32      =   0x40,
        RADV_PERFTEST_GE_WAVE_32      =   0x80,
        RADV_PERFTEST_DFSM            =  0x100,
-       RADV_PERFTEST_ACO             =  0x200,
 };
 
 bool
index 23777f3..0a0443e 100644 (file)
@@ -338,7 +338,7 @@ radv_physical_device_try_create(struct radv_instance *instance,
        device->local_fd = fd;
        device->ws->query_info(device->ws, &device->rad_info);
 
-       device->use_llvm = !(instance->perftest_flags & RADV_PERFTEST_ACO);
+       device->use_llvm = instance->debug_flags & RADV_DEBUG_LLVM;
 
        snprintf(device->name, sizeof(device->name),
                 "AMD RADV %s (%s)",
@@ -360,7 +360,7 @@ radv_physical_device_try_create(struct radv_instance *instance,
        disk_cache_format_hex_id(buf, device->cache_uuid, VK_UUID_SIZE * 2);
        device->disk_cache = disk_cache_create(device->name, buf, shader_env_flags);
 
-       if (device->rad_info.chip_class < GFX8)
+       if (device->rad_info.chip_class < GFX8 || !device->use_llvm)
                fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
 
        radv_get_driver_uuid(&device->driver_uuid);
@@ -528,7 +528,6 @@ static const struct debug_control radv_perftest_options[] = {
        {"pswave32", RADV_PERFTEST_PS_WAVE_32},
        {"gewave32", RADV_PERFTEST_GE_WAVE_32},
        {"dfsm", RADV_PERFTEST_DFSM},
-       {"aco", RADV_PERFTEST_ACO},
        {NULL, 0}
 };
 
@@ -559,7 +558,7 @@ radv_handle_per_app_options(struct radv_instance *instance,
                                instance->debug_flags |= RADV_DEBUG_NO_LOAD_STORE_OPT;
                } else if (!strcmp(name, "Wolfenstein: Youngblood")) {
                        if (!(instance->debug_flags & RADV_DEBUG_NO_SHADER_BALLOT) &&
-                           !(instance->perftest_flags & RADV_PERFTEST_ACO)) {
+                           (instance->debug_flags & RADV_DEBUG_LLVM)) {
                                /* Force enable VK_AMD_shader_ballot because it looks
                                 * safe and it gives a nice boost (+20% on Vega 56 at
                                 * this time). It also prevents corruption on LLVM.
@@ -678,13 +677,6 @@ VkResult radv_CreateInstance(
        instance->perftest_flags = parse_debug_string(getenv("RADV_PERFTEST"),
                                                   radv_perftest_options);
 
-       if (instance->debug_flags & RADV_DEBUG_LLVM) {
-               instance->perftest_flags &= ~RADV_PERFTEST_ACO;
-       }
-
-       if (instance->perftest_flags & RADV_PERFTEST_ACO)
-               fprintf(stderr, "WARNING: Experimental compiler backend enabled. Here be dragons! Incorrect rendering, GPU hangs and/or resets are likely\n");
-
        if (instance->debug_flags & RADV_DEBUG_STARTUP)
                radv_logi("Created an instance");
 
index 3c0e6a5..29e7b20 100644 (file)
@@ -46,13 +46,13 @@ do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
                return false;
 
        /* LLVM 11 is required for GFX10.3. */
-       if (ws->info.chip_class == GFX10_3 && !ws->use_aco && LLVM_VERSION_MAJOR < 11) {
+       if (ws->info.chip_class == GFX10_3 && ws->use_llvm && LLVM_VERSION_MAJOR < 11) {
                fprintf(stderr, "radv: GFX 10.3 requires LLVM 11 or higher\n");
                return false;
        }
 
        /* LLVM 9.0 is required for GFX10. */
-       if (ws->info.chip_class == GFX10 && !ws->use_aco && LLVM_VERSION_MAJOR < 9) {
+       if (ws->info.chip_class == GFX10 && ws->use_llvm && LLVM_VERSION_MAJOR < 9) {
                fprintf(stderr, "radv: Navi family support requires LLVM 9 or higher\n");
                return false;
        }
@@ -194,7 +194,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags)
 
        ws->use_local_bos = perftest_flags & RADV_PERFTEST_LOCAL_BOS;
        ws->zero_all_vram_allocs = debug_flags & RADV_DEBUG_ZERO_VRAM;
-       ws->use_aco = perftest_flags & RADV_PERFTEST_ACO;
+       ws->use_llvm = debug_flags & RADV_DEBUG_LLVM;
        list_inithead(&ws->global_bo_list);
        pthread_mutex_init(&ws->global_bo_list_lock, NULL);
        ws->base.query_info = radv_amdgpu_winsys_query_info;
index 2ec223d..0601481 100644 (file)
@@ -46,7 +46,7 @@ struct radv_amdgpu_winsys {
        bool use_ib_bos;
        bool zero_all_vram_allocs;
        bool use_local_bos;
-       bool use_aco;
+       bool use_llvm;
        unsigned num_buffers;
 
        pthread_mutex_t global_bo_list_lock;