Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amdvlk: 2020.Q3.1 -> 2020.Q3.2 #93698

Merged
merged 1 commit into from Jul 23, 2020
Merged

Conversation

danieldk
Copy link
Contributor

Motivation for this change

Changelog:

https://github.com/GPUOpen-Drivers/AMDVLK/releases/tag/v-2020.Q3.2

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Flakebi
Copy link
Member

Flakebi commented Jul 23, 2020

I tested it but I’m seeing segfaults when starting vkcube. It does not seem to be directly related to amdvlk itself though.

Having old versions of the (runtime) dependencies in LD_LIBRARY_PATH makes it work.
Switching out vulkan-loader in LD_LIBRARY_PATH with a current version and leaving the rest the same makes vkcube segfault.

Runtime dependencies are: [ libdrm openssl vulkan-loader wayland xorg.libX11 xorg.libxcb xorg.libxshmfence ]

That’s all I got so far.

@danieldk
Copy link
Contributor Author

danieldk commented Jul 23, 2020

Good catch. I created a debug build. Output:

AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_create_sem (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_signal_sem (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_wait_sem (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_export_sem (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_import_sem (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_destroy_sem (/build/amdvlk-src/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 (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_bo_remap_secure (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_query_private_aperture (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_query_shared_aperture (/build/amdvlk-src/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 (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_reserved_vmid (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_unreserved_vmid (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_syncobj_query2 (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Failed to get function pointer for: amdgpu_cs_ctx_create3 (/build/amdvlk-src/drivers/pal/inc/util/palLibrary.h:84:GetFunction)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/build/amdvlk-src/drivers/pal/src/core/os/amdgpu/amdgpuDevice.cpp:656:EarlyInit)
AMD-PAL: Warn: Unconditional Alert | Reason: Unknown (/build/amdvlk-src/drivers/pal/src/core/os/amdgpu/amdgpuDevice.cpp:656:EarlyInit)
AMD-PAL: Warn: Alert triggered: IsErrorResult(result) | Reason: Unknown (/build/amdvlk-src/drivers/pal/src/util/lnx/lnxOpenssl.cpp:57:OpenLibrary)
AMD-PAL: Warn: Alert triggered: IsErrorResult(result) | Reason: Unknown (/build/amdvlk-src/drivers/pal/src/util/platformKey.cpp:45:GetPlatformKeySize)
AMD-PAL: Error: Assertion failed: IsPowerOfTwo(alignment) | Reason: Unknown (/build/amdvlk-src/drivers/pal/inc/util/palInlineFuncs.h:469:Pow2Align)
zsh: trace trap (core dumped)  /nix/store/l267swbvlwnz8zz3jw8138iivahk4fqd-vulkan-tools-1.2.131.1/bin/vkcube

Backtrace:

(gdb) bt full
#0  __GI_raise (sig=sig@entry=5) at ../sysdeps/unix/sysv/linux/raise.c:50
        set = {__val = {0, 6651767366868306944, 0, 0, 472446402651, 140737323736517, 140737324062056, 
            140737323744904, 140737488307152, 140737281317254, 57, 140737323747671, 140737488305672, 
            140737488305672, 16, 140737488305672}}
        pid = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
#1  0x00007ffff384ab68 in Util::Pow2Align<unsigned long> (value=40, alignment=0)
    at /build/amdvlk-src/drivers/pal/inc/util/palInlineFuncs.h:435
        __func__ = "Pow2Align"
#2  0x00007ffff3a8733f in Util::GetPlatformKeySize (algorithm=algorithm@entry=Util::HashAlgorithm::Sha1)
    at /build/amdvlk-src/drivers/pal/src/util/platformKey.cpp:51
        i = 0
        info = {contextObjectSize = 0, contextObjectAlignment = 0, outputBufferSize = 0}
        result = <optimized out>
        __func__ = "GetPlatformKeySize"
        size = <optimized out>
#3  0x00007ffff38ae357 in vk::PhysicalDevice::InitializePlatformKey (this=this@entry=0x6be9a8, settings=...)
    at /build/amdvlk-src/drivers/xgl/icd/api/vk_physical_device.cpp:546
        memSize = <optimized out>
        pMem = <optimized out>
        initialData = {properties = {apiVersion = 4202642, driverVersion = 8388760, vendorID = 4098, 
            deviceID = 26591, deviceType = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, 
            deviceName = "Radeon RX 580 Series", '\000' <repeats 235 times>, 
            pipelineCacheUUID = "\032\371\255^\350+\270\372b.\317|LşQ", limits = {maxImageDimension1D = 0, 
              maxImageDimension2D = 0, maxImageDimension3D = 0, maxImageDimensionCube = 0, 
              maxImageArrayLayers = 0, maxTexelBufferElements = 0, maxUniformBufferRange = 0, 
              maxStorageBufferRange = 0, maxPushConstantsSize = 0, maxMemoryAllocationCount = 0, 
              maxSamplerAllocationCount = 0, bufferImageGranularity = 0, sparseAddressSpaceSize = 0, 
              maxBoundDescriptorSets = 0, maxPerStageDescriptorSamplers = 0, 
              maxPerStageDescriptorUniformBuffers = 0, maxPerStageDescriptorStorageBuffers = 0, 
              maxPerStageDescriptorSampledImages = 0, maxPerStageDescriptorStorageImages = 0, 
              maxPerStageDescriptorInputAttachments = 0, maxPerStageResources = 0, 
              maxDescriptorSetSamplers = 0, maxDescriptorSetUniformBuffers = 0, 
--Type <RET> for more, q to quit, c to continue without paging--
              maxDescriptorSetUniformBuffersDynamic = 0, maxDescriptorSetStorageBuffers = 0, 
              maxDescriptorSetStorageBuffersDynamic = 0, maxDescriptorSetSampledImages = 0, 
              maxDescriptorSetStorageImages = 0, maxDescriptorSetInputAttachments = 0, 
              maxVertexInputAttributes = 0, maxVertexInputBindings = 0, maxVertexInputAttributeOffset = 0, 
              maxVertexInputBindingStride = 0, maxVertexOutputComponents = 0, 
              maxTessellationGenerationLevel = 0, maxTessellationPatchSize = 0, 
              maxTessellationControlPerVertexInputComponents = 0, 
              maxTessellationControlPerVertexOutputComponents = 0, 
              maxTessellationControlPerPatchOutputComponents = 0, 
              maxTessellationControlTotalOutputComponents = 0, 
              maxTessellationEvaluationInputComponents = 0, maxTessellationEvaluationOutputComponents = 0, 
              maxGeometryShaderInvocations = 0, maxGeometryInputComponents = 0, 
              maxGeometryOutputComponents = 0, maxGeometryOutputVertices = 0, 
              maxGeometryTotalOutputComponents = 0, maxFragmentInputComponents = 0, 
              maxFragmentOutputAttachments = 0, maxFragmentDualSrcAttachments = 0, 
              maxFragmentCombinedOutputResources = 0, maxComputeSharedMemorySize = 0, 
              maxComputeWorkGroupCount = {0, 0, 0}, maxComputeWorkGroupInvocations = 0, 
              maxComputeWorkGroupSize = {0, 0, 0}, subPixelPrecisionBits = 0, subTexelPrecisionBits = 0, 
              mipmapPrecisionBits = 0, maxDrawIndexedIndexValue = 0, maxDrawIndirectCount = 0, 
              maxSamplerLodBias = 0, maxSamplerAnisotropy = 0, maxViewports = 0, maxViewportDimensions = {
                0, 0}, viewportBoundsRange = {0, 0}, viewportSubPixelBits = 0, minMemoryMapAlignment = 0, 
              minTexelBufferOffsetAlignment = 0, minUniformBufferOffsetAlignment = 0, 
              minStorageBufferOffsetAlignment = 0, minTexelOffset = 0, maxTexelOffset = 0, 
              minTexelGatherOffset = 0, maxTexelGatherOffset = 0, minInterpolationOffset = 0, 
              maxInterpolationOffset = 0, subPixelInterpolationOffsetBits = 0, maxFramebufferWidth = 0, 
              maxFramebufferHeight = 0, maxFramebufferLayers = 0, framebufferColorSampleCounts = 0, 
              framebufferDepthSampleCounts = 0, framebufferStencilSampleCounts = 0, 
              framebufferNoAttachmentsSampleCounts = 0, maxColorAttachments = 0, 
              sampledImageColorSampleCounts = 0, sampledImageIntegerSampleCounts = 0, 
              sampledImageDepthSampleCounts = 0, sampledImageStencilSampleCounts = 0, 
              storageImageSampleCounts = 0, maxSampleMaskWords = 0, timestampComputeAndGraphics = 0, 
              timestampPeriod = 0, maxClipDistances = 0, maxCullDistances = 0, 
              maxCombinedClipAndCullDistances = 0, discreteQueuePriorities = 0, pointSizeRange = {0, 0}, 
              lineWidthRange = {0, 0}, pointSizeGranularity = 0, lineWidthGranularity = 0, strictLines = 0, 
--Type <RET> for more, q to quit, c to continue without paging--
              standardSampleLocations = 0, optimalBufferCopyOffsetAlignment = 0, 
              optimalBufferCopyRowPitchAlignment = 0, nonCoherentAtomSize = 0}, sparseProperties = {
              residencyStandard2DBlockShape = 1, residencyStandard2DMultisampleBlockShape = 0, 
              residencyStandard3DBlockShape = 0, residencyAlignedMipSize = 0, 
              residencyNonResidentStrict = 1}}, timestamp = {0x0 <repeats 25 times>}}
        result = <optimized out>

Didn't have time to dig deeper yet.

@danieldk
Copy link
Contributor Author

When I add OpenSSL to the library path, these assertions errors are gone:

AMD-PAL: Warn: Alert triggered: IsErrorResult(result) | Reason: Unknown (/build/amdvlk-src/drivers/pal/src/util/lnx/lnxOpenssl.cpp:57:OpenLibrary)
AMD-PAL: Warn: Alert triggered: IsErrorResult(result) | Reason: Unknown (/build/amdvlk-src/drivers/pal/src/util/platformKey.cpp:45:GetPlatformKeySize)
AMD-PAL: Error: Assertion failed: IsPowerOfTwo(alignment) | Reason: Unknown (/build/amdvlk-src/drivers/pal/inc/util/palInlineFuncs.h:469:Pow2Align)

Now raises an exception in VerifyExtensions:

1  0x00007ffff38ade7d in vk::VerifyExtensions (dev=...)
    at /build/amdvlk-src/drivers/xgl/icd/api/vk_physical_device.cpp:6242
        apiVersion = 4202642
        __func__ = "VerifyExtensions"
#2  0x00007ffff38adf0d in vk::VerifyProperties (device=...)
    at /build/amdvlk-src/drivers/xgl/icd/api/vk_physical_device.cpp:6284
        limits = {maxImageDimension1D = 16384, maxImageDimension2D = 16384, maxImageDimension3D = 2048, 
          maxImageDimensionCube = 16384, maxImageArrayLayers = 2048, maxTexelBufferElements = 4294967295, 
          maxUniformBufferRange = 4294967295, maxStorageBufferRange = 4294967295, maxPushConstantsSize = 128, 
          maxMemoryAllocationCount = 4294967295, maxSamplerAllocationCount = 1048576, bufferImageGranularity = 1, 
          sparseAddressSpaceSize = 106300440576, maxBoundDescriptorSets = 32, 
          maxPerStageDescriptorSamplers = 4294967295, maxPerStageDescriptorUniformBuffers = 4294967295, 
          maxPerStageDescriptorStorageBuffers = 4294967295, maxPerStageDescriptorSampledImages = 4294967295, 
          maxPerStageDescriptorStorageImages = 4294967295, maxPerStageDescriptorInputAttachments = 4294967295, 
          maxPerStageResources = 4294967295, maxDescriptorSetSamplers = 4294967295, 
          maxDescriptorSetUniformBuffers = 4294967295, maxDescriptorSetUniformBuffersDynamic = 8, 
          maxDescriptorSetStorageBuffers = 4294967295, maxDescriptorSetStorageBuffersDynamic = 8, 
          maxDescriptorSetSampledImages = 4294967295, maxDescriptorSetStorageImages = 4294967295, 
          maxDescriptorSetInputAttachments = 4294967295, maxVertexInputAttributes = 64, maxVertexInputBindings = 32, 
          maxVertexInputAttributeOffset = 4294967295, maxVertexInputBindingStride = 16383, 
          maxVertexOutputComponents = 128, maxTessellationGenerationLevel = 64, maxTessellationPatchSize = 32, 
          maxTessellationControlPerVertexInputComponents = 128, maxTessellationControlPerVertexOutputComponents = 128, 
          maxTessellationControlPerPatchOutputComponents = 120, maxTessellationControlTotalOutputComponents = 4096, 
          maxTessellationEvaluationInputComponents = 128, maxTessellationEvaluationOutputComponents = 128, 
          maxGeometryShaderInvocations = 127, maxGeometryInputComponents = 128, maxGeometryOutputComponents = 128, 
          maxGeometryOutputVertices = 1024, maxGeometryTotalOutputComponents = 16384, maxFragmentInputComponents = 128, 
          maxFragmentOutputAttachments = 8, maxFragmentDualSrcAttachments = 1, 
          maxFragmentCombinedOutputResources = 4294967295, maxComputeSharedMemorySize = 65536, 
          maxComputeWorkGroupCount = {65535, 65535, 65535}, maxComputeWorkGroupInvocations = 1024, 
          maxComputeWorkGroupSize = {1024, 1024, 1024}, subPixelPrecisionBits = 8, subTexelPrecisionBits = 8,

@danieldk
Copy link
Contributor Author

danieldk commented Jul 23, 2020

I have pushed the change that adds openssl to rpath and vkcube now works with a release build.

Copy link
Member

@Flakebi Flakebi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
vkcube works for me too now.

Sidenote: Do you know the best way to build a 32-bit package by chance? (#93027)

@danieldk
Copy link
Contributor Author

Sidenote: Do you know the best way to build a 32-bit package by chance? (#93027)

No experience, but I think adding to

driversi686Linux = recurseIntoAttrs {

and then modifying the derivation to support i686 (like you did in your branch).

@danieldk danieldk merged commit 31c04fa into NixOS:master Jul 23, 2020
@danieldk danieldk deleted the amdvlk-2020.Q3.2 branch July 23, 2020 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants