diff --git a/meson.build b/meson.build index 8655c8d4129..c296dd0060e 100644 --- a/meson.build +++ b/meson.build @@ -370,6 +370,9 @@ endif if with_radv_tests and not with_amd_vk error('RADV tests require RADV') endif +if with_radv_tests and not with_tools.contains('drm-shim') + error('RADV tests require AMDGPU drm-shim') +endif with_microsoft_clc = get_option('microsoft-clc').enabled() with_spirv_to_dxil = get_option('spirv-to-dxil') diff --git a/src/amd/meson.build b/src/amd/meson.build index aae0bf636c2..92fe3d19053 100644 --- a/src/amd/meson.build +++ b/src/amd/meson.build @@ -3,6 +3,10 @@ inc_amd = include_directories('.') +if with_tools.contains('drm-shim') + subdir('drm-shim') +endif + if with_amd_vk or with_gallium_radeonsi subdir('addrlib') subdir('common') @@ -21,10 +25,6 @@ if with_amd_vk endif endif -if with_tools.contains('drm-shim') - subdir('drm-shim') -endif - if with_gallium_radeonsi subdir('vpelib') subdir('gmlib') diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build index e3c41ed59f3..8482848cff0 100644 --- a/src/amd/vulkan/meson.build +++ b/src/amd/vulkan/meson.build @@ -349,5 +349,9 @@ if with_radv_tests ), suite : ['compiler', 'nir'], protocol : 'gtest', + env : [ + 'LD_PRELOAD=@0@'.format(libamdgpu_noop_drm_shim.full_path()), + 'AMDGPU_GPU_ID=navi21', + ], ) endif diff --git a/src/amd/vulkan/tests/helpers.cpp b/src/amd/vulkan/tests/helpers.cpp index bf5e4554224..11ce9f0fc6b 100644 --- a/src/amd/vulkan/tests/helpers.cpp +++ b/src/amd/vulkan/tests/helpers.cpp @@ -13,14 +13,11 @@ PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, con radv_test::radv_test() { - /* Force the driver to create a noop device that doesn't require AMDGPU. */ - setenv("RADV_FORCE_FAMILY", "navi21", 1); } radv_test::~radv_test() { assert(envvars.size() == 0); - unsetenv("RADV_FORCE_FAMILY"); } void