GPUOpen-Drivers / AMDVLK

AMD Open Source Driver For Vulkan
MIT License
1.76k stars 162 forks source link

ICD doesn't run clean with assertions enabled #172

Closed kuhar closed 3 years ago

kuhar commented 4 years ago

A fresh checkout of the dev branch of ICD reports multiple failures when built with assertions enabled.

My cmake invocation: cmake -H. -Bbuilds/Debug64 -GNinja -DCMAKE_BUILD_TYPE=Debug -DXGL_BUILD_LIT=ON

$ gcc --version
gcc (Debian 9.3.0-8) 9.3.0
$ uname -r
5.6.14-1<redacted>-amd64

GPU: V320 (Vega)

When I run vkcube, I get:

$ DISPLAY=:1 VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amdvlk_dbg64.json vkcube 
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_create_sem (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_signal_sem (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_wait_sem (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_export_sem (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_import_sem (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_destroy_sem (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_create_bo_from_phys_mem (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_bo_remap_secure (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_query_private_aperture (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_query_shared_aperture (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_bo_get_phys_address (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_reserved_vmid (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_unreserved_vmid (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_ctx_create3 (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/src/core/os/amdgpu/amdgpuDevice.cpp:656:EarlyInit)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/src/core/os/amdgpu/amdgpuDevice.cpp:656:EarlyInit)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/src/core/hw/gfxip/gfx9/gfx9GraphicsPipeline.cpp:1322:SetupNonShaderRegisters)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/src/core/hw/gfxip/gfx9/gfx9GraphicsPipeline.cpp:1322:SetupNonShaderRegisters)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/src/core/hw/gfxip/gfx9/gfx9GraphicsPipeline.cpp:1322:SetupNonShaderRegisters)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/ssd/opensource/amdvlk/vulkandriver/drivers/pal/src/core/hw/gfxip/gfx9/gfx9GraphicsPipeline.cpp:1322:SetupNonShaderRegisters)

The vulkan application does run in this configuration, but it's unclear to me how important these assertions failures are and if they indicate real problems.

Flakebi commented 4 years ago

These are PAL assertions and they can/need to be ignored as far as I know. That said, I would welcome it if the assertions would actually be useful and not firing by default.

For reference, if someone hits a PAL assertions that aborts the program (happens e.g. with libdrm < 2.4.101: #153), adding HardAssert,0 to .config/amdPalSettings.cfg makes it non-fatal.

brianbAMD commented 4 years ago

The referenced warnings are all actually PAL_ALERTs not PAL_ASSERTS. Maybe confusing, but ALERTs aren't meant to be fatal but flag "interesting" conditions. E.g., as system call failure wouldn't cause an assert since we should be able to gracefully handle it, but it might get an alert since if you're debugging an issue where a system call failure happens, it might be helpful to draw attention to the failure. ALERTs do not interrupt execution by default, they just print debug messages.

I'll check on these internally to see if they still are worthy of ALERTs. If those thunk function pointers are never available anymore, then we should remove the ALERT. The others looks to be due to not being able to find the setting .cfg file and creating pipeline where the set of bound targets doesn't match the set of PS outputs.