How to fix VK_KHR_portability_subset error on mac m1 while following vulkan tutorial - vulkan

Hi i'm having an error on compile. Apparently i'm missing an extension :
validation layer: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] Object 0: handle = 0x1055040c0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID = 0x3a3b6ca0 | vkCreateDevice: VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x1055040c0[] supports it The Vulkan spec states: If the [VK_KHR_portability_subset] extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensions must include "VK_KHR_portability_subset". (https://vulkan.lunarg.com/doc/view/1.2.176.1/mac/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pProperties-04451)
I naively added to the deviceExtension vector "VK_KHR_portability_subset" and then got a second error who seems to be similar to the previous one.
validation layer: Validation Error: [ VUID-vkCreateDevice-ppEnabledExtensionNames-01387 ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x12537a2c | Missing extension required by the device extension VK_KHR_portability_subset: VK_KHR_get_physical_device_properties2. The Vulkan spec states: All required extensions for each extension in the VkDeviceCreateInfo::ppEnabledExtensionNames list must also be present in that list (https://vulkan.lunarg.com/doc/view/1.2.176.1/mac/1.2-extensions/vkspec.html#VUID-vkCreateDevice-ppEnabledExtensionNames-01387)
I added to the deviceExtension vector "VK_KHR_get_physical_device_properties2" and then got a third error :
libc++abi: terminating with uncaught exception of type std::runtime_error: failed to find a suitable GPU!
The thing is that previously he recognized that i was using a m1 chip but now no informations on the device shows :(

I added to the deviceExtension vector "VK_KHR_get_physical_device_properties2"
VK_KHR_get_physical_device_properties2 is an instance extension, and as such belongs to vkCreateInstance (not device).
Reportedly, that fixed your issue.

I have encountered same message on same device and after some research understood it's not error, just a warning. If you don't really need to handle this special case, you can just ignore it.

Related

Generated SPIR-V with -fvk-use-scalar-layout flag using DirectxShaderCompiler causes validation layer error

I have a fairly simple HLSL shader that is being compiled into SPIR-V using DirectxShaderCompiler. Though, using scalar layout causes validation layer error. I have enabled the VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME extension while creating the VkDevice. Is it a validation layer, or dxc bug or do I require an additional flag to generate SPIR-V?
Command to generate SPIR-V:
COMMAND $ENV{VULKAN_SDK}/bin/dxc -spirv -fvk-use-scalar-layout -fvk-invert-y -T vs_6_0 -E ${vertexEntry} ${file} -Fo ${CMAKE_SOURCE_DIR}/Assets/${vertexEntry}.spv
Validation layer error:
Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x1e320175dc0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: Structure id 7 decorated as BufferBlock for variable in Uniform storage class must follow relaxed storage buffer layout rules: member 1 is an improperly straddling vector at offset 12
%Vertex = OpTypeStruct %v3float %v3float %v2float

Why is VK_SAMPLE_COUNT_1_BIT an invalid choice for multisampling in Vulkan?

Hello people of StackOverflow,
I am currently working on a games engine using the Vulkan graphics API, in the past I was just setting anti-aliasing to the max it could be. However today I was trying to turn it off (to improve performance on weaker systems). To do this I tried to set the MSAA samples on my engine to VK_SAMPLE_COUNT_1_BIT however this produced the validation error:
Validation Error: [ VUID-VkSubpassDescription-pResolveAttachments-00848 ] Object 0: handle = 0x55aaa6e32828, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xfad6c3cb | ValidateCreateRenderPass(): Subpass 0 requests multisample resolve from attachment 0 which has VK_SAMPLE_COUNT_1_BIT. The Vulkan spec states: If pResolveAttachments is not NULL, for each resolve attachment that is not VK_ATTACHMENT_UNUSED, the corresponding color attachment must not have a sample count of VK_SAMPLE_COUNT_1_BIT (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkSubpassDescription-pResolveAttachments-00848)
I can work around this problem relatively easily so it isn't really an issue for me, however I was wondering why exactly this limit is put into place. If I want to set the MSAA samples to 1 why can't I?
Thanks,
sckzor
A sample count of 1 means "not a multisampled image". And if you're doing multisample resolve, resolving from a non-multisampled image doesn't make sense. Which is also why you can't use such images for any other things that expect a multisampled image (you can't use an MS-style sampler or texture function on them).

vkMapMemory validation error on vkQueuePresentKHR, but never called the function directly

When calling vkQueuePresentKHR i get the following validation error:
Validation Error: [ VUID-vkMapMemory-size-00680 ] Object 0: handle = 0x8483000000000025, type = VK_OBJECT_TYPE_DEVICE_MEMORY; | MessageID = 0xff4787ab | VkMapMemory: Attempting to map memory range of size zero The Vulkan spec states: If size is not equal to VK_WHOLE_SIZE, size must be greater than 0 (https://vulkan.lunarg.com/doc/view/1.2.148.0/windows/1.2-extensions/vkspec.html#VUID-vkMapMemory-size-00680)
I never called vkMapMemory() directly.
Here is an excerpt of my code: https://gist.github.com/alexandru-cazacu/7847161564daa5f93d1bada39280faa8
Closing RivaTuner Statistics Server fixed the issue.
I had 3 other validation errors caused by it.
As stated in https://vulkan-tutorial.com/FAQ
I get an access violation error in the core validation layer: Make sure that MSI Afterburner / RivaTuner Statistics Server is not
running, because it has some compatibility problems with Vulkan.

Value of type 'Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer' cannot be converted to 'System.Type

I'm working on a custom TFS Build workflow based on the code found in two blogs:
http://www.theringworx.com/blog/?p=494
https://lajak.wordpress.com/2011/08/30/tfs2010-retrieve-associated-workitems-to-changesets-tfs-api/
When I implement the VB.Net code within my XAML workflow, I'm currently getting the following errors on build runtime:
The build process failed validation. Details:
Validation Error: The private implementation of activity '1:
DynamicActivity' has the following validation error: Compiler
error(s) encountered processing expression "TFSService".
Value of type
'Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer'
cannot be converted to 'System.Type'.
Validation Error: The private implementation of activity '1:
DynamicActivity' has the following validation error: Compiler
error(s) encountered processing expression "TFS.GetService(Of
VersionControlServer)();".
End of expression expected.
I've traced the error down to this section of code (Simplified from XAML):
TFS=Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory.GetTeamProjectCollectionFactory(New Uri("MyTeamsTFSServer"))
TFSService = TFS.GetService(Of VersionControlServer)()
I've tried changing the type of TFSService from both Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer and System.Type without success.
From what I can tell the error is occurring in the "Of VersionControlServer".
Has anyone ever encountered this? And if so how did you resolve it?
Turns out the issue was the URL I was using, I made a typo when I was entering it in. Yay for descriptive error messages...
I found this while I was checking my authentication using the two methods:
TFS.HasAuthenticated
TFS.Authenticate();
My code blew out when I was running the Authenticate() method.

Mounting a network volume from OS X App

I'm trying to mount a network volume in a OS X App.
I get it to work using the FSMountServerVolume function which is deprecated. The documentation says "To mount a network volume, use NetFSMountURLAsync instead". But when I try to use this function I get the following error message:
dyld: lazy symbol binding failed: Symbol not found: _NetFSMountURLSync
Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/AppName-ammmlfwhvlfxkdburfmzioformdn/Build/Products/Debug/AppName.app/Contents/MacOS/AppName
Expected in: /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
dyld: Symbol not found: _NetFSMountURLSync
Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/AppName-ammmlfwhvlfxkdburfmzioformdn/Build/Products/Debug/AppName.app/Contents/MacOS/AppName
Expected in: /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
Did I forget anything? I imported the NetFS Framework.
OK, it looks like NetFSMountURLSync() etc where introduced in 10.8.
From NetFS Changes:
Added AsyncRequestID
Added NetFSMountURLAsync()
Added NetFSMountURLBlock
Added NetFSMountURLCancel()
Added NetFSMountURLSync()
Added #def kNAUIOptionAllowUI
Added #def kNAUIOptionForceUI
Added #def kNAUIOptionKey
Added #def kNAUIOptionNoUI
Added #def kNetFSMountAtMountDirKey
Therefore you are going to have to use the "old way" in 10.7 and below and the "new way" in 10.8 and above. This means making the NetFS.framework optional rather than required and the need to perform various runtime checks to see which API you need to use.