Couldn't find VkNonDispatchableHandle - c++

I'm using Vulkan to create a simple program. After I resize the window, the validation layer gives me this output. The resize itself works fine. What does it say? The complete error is following:
UNASSIGNED-Threading-Info(ERROR / SPEC): msgNum: 1567320034 - Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0xee3a9100000000b4, type = VK_OBJECT_TYPE_UNKNOWN; | MessageID = 0x5d6b67e2 | Couldn't find VkNonDispatchableHandle Object 0xee3a9100000000b4. This should not happen and may indicate a bug in the application.
Objects: 1
[0] 0xee3a9100000000b4, type: 0, name: NULL
What causes the problem?

I fixed it up.
The reason, that caused the Problem was, that I tried to destroy a Swapchain which was set to VK_NULL_HANDLE.

Related

Using debugPrintfEXT in Vulkan

I'm trying to figure out how to use debugPrintfEXT but with no luck.
First I've enabled the extension in my vertex shader
#version 450
#extension GL_EXT_debug_printf : enable
void main()
{
debugPrintfEXT("Test");
// ... some more stuff here ...
}
Then I specify the necessary extensions for the Vulkan instance
VkValidationFeatureEnableEXT enables[] = {VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT};
VkValidationFeaturesEXT features = {};
features.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT;
features.enabledValidationFeatureCount = 1;
features.pEnabledValidationFeatures = enables;
VkInstanceCreateInfo info = {};
info.pNext = &features;
In the info.ppEnabledExtensionNames field I specified VK_EXT_validation_features and VK_EXT_debug_utils among other things.
When I run my app, I get the following logs
VUID_Undefined(ERROR / SPEC): msgNum: 2044605652 - Validation Error: [ VUID_Undefined ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x79de34d4 | vkCreateDebugUtilsMessengerEXT: value of pCreateInfo->pNext must be NULL. This error is based on the Valid Usage documentation for version 182 of the Vulkan header. It is possible that you are using a struct from a private extension or an extension that was added to a later version of the Vulkan header, in which case the use of pCreateInfo->pNext is undefined and may not work correctly with validation enabled
Objects: 1
[0] 0, type: 3, name: NULL
[Debug][Error][Validation]"Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-04147 ] Object 0: handle = 0x5651b647e828, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x3d492883 | vkCreateShaderModule(): The SPIR-V Extension (SPV_KHR_non_semantic_info) was declared, but none of the requirements were met to use it. The Vulkan spec states: If pCode declares any of the SPIR-V extensions listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://vulkan.lunarg.com/doc/view/1.2.182.0/linux/1.2-extensions/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-04147)"
What more should I do? And what does
one of the corresponding requirements must be satisfied
mean? Is there something that I'm missing?
Edit:
As suggested by Karl Schultz, it's necessary to add VK_KHR_shader_non_semantic_info to info.ppEnabledExtensionNames.
Also, make sure to set log level to INFO with VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT in VkDebugUtilsMessengerCreateInfoEXT::messageSeverity. By default all the output produced by debugPrintfEXT has INFO level.
You may also see
Printf message was truncated, likely due to a buffer size that was too small for the message
if you spawn too many threads, each printing its own long logs.
You also need to enable the VK_KHR_shader_non_semantic_info device extension in your application code when you create the device.
LunarG has also recently published a white paper about debugPrintfEXT.

Granite ORM + fiber + mysql = Unexpected EOF (Exception)?

Is working with Fibers in Granite possible? I didn't have a reason to believe otherwise, until I attempted to write some code for it. I am attempting to learn to work with Fibers, so perhaps incorrect fiber implementation could also be a cause. The following code results in an exception. Any hints to resolve this?
lines = File.read_lines INVENTORY_FILE
channel = Channel(Int32).new(199)
lines[0..200].each do |line|
row_number += 1
proc = ->(line : NamedTuple(item_number: String) do
spawn do
sku = Sku.find_by :item_number, item_number
channel.send(1)
end
end
proc.call({ line: line })
end
199.times do |i|
channel.receive
end
The above results in the following repeated exception starting from the very first fiber's attempt to access the DB. I've ensured that MySQL is in a working state and that the code works when fibers are not in use:
Unexpected EOF (Exception)
from lib/mysql/src/mysql/read_packet.cr:38:18 in 'read_byte!'
from lib/mysql/src/mysql/read_packet.cr:63:5 in 'read_int'
from lib/mysql/src/mysql/packets.cr:13:7 in 'read'
from lib/mysql/src/mysql/connection.cr:63:14 in 'read_packet'
from lib/mysql/src/mysql/connection.cr:22:19 in 'initialize'
from lib/mysql/src/mysql/connection.cr:4:3 in 'new'
from lib/mysql/src/mysql/driver.cr:3:5 in 'build_connection'
from lib/db/src/db/pool.cr:255:3 in 'build_resource'
from lib/db/src/db/pool.cr:34:22 in 'checkout'
from lib/db/src/db/pool.cr:65:7 in 'checkout_some'
from lib/db/src/db/database.cr:99:7 in 'checkout_some'
from lib/db/src/db/pool_prepared_statement.cr:35:24 in 'build_statement'
from lib/db/src/db/pool_prepared_statement.cr:53:22 in 'initialize'
from lib/db/src/db/pool_prepared_statement.cr:11:5 in 'new'
from lib/db/src/db/database.cr:89:7 in 'build_prepared_statement'
from lib/db/src/db/database.cr:7:15 in 'fetch_or_build_prepared_statement'
from lib/db/src/db/session_methods.cr:23:9 in 'build'
from lib/db/src/db/query_methods.cr:38:7 in 'query'
from lib/granite/src/granite/querying.cr:53:12 in 'find_by'
from /usr/share/crystal/src/kernel.cr:0:3 in '~procProc(Nil)'
from /usr/share/crystal/src/fiber.cr:255:3 in 'run'
from /usr/share/crystal/src/concurrent.cr:0:3 in '~proc2Proc(Fiber, (IO::FileDescriptor | Nil))'
from ???

SpotFleetRequest - Tag specification resource type must have a value

For the past few weeks I was able to create SpotFleetRequests just fine (via Java). However since yesterday I am getting the following error:
com.amazonaws.services.ec2.model.AmazonEC2Exception: Tag specification resource type must have a value (Service: AmazonEC2; Status Code: 400; Error Code: InvalidSpotFleetRequestConfig; Request ID: ef69f477-e8f3-4d86-aa91-1646c4067d68)
I didn't really change anything and what's even weirder: I've already added a SpotFleetTagSpecification inside the SpotFleetLaunchSpecification of my SpotFleetRequestConfigData.
Here is my code:
List<Tag> tags = new ArrayList<>();
tags.add(new Tag("TEAM", "CROCODILE"));
SpotFleetTagSpecification tagSpec = new SpotFleetTagSpecification().withTags(tags);
SpotFleetLaunchSpecification launchSpec = new SpotFleetLaunchSpecification()
.withSecurityGroups(new GroupIdentifier().withGroupId(securityGroupId))
.withIamInstanceProfile(new IamInstanceProfileSpecification().withArn(instanceProfileArn))
.withImageId(imageId)
.withInstanceType(InstanceType.M3Xlarge)
.withSubnetId(subnetIds)
.withUserData(getUserDataToConfigureECSCluster(ecsClusterName))
.withTagSpecifications(tagSpec);
// Configure the actual request
SpotFleetRequestConfigData config = new SpotFleetRequestConfigData()
.withIamFleetRole(fleetRoleArn)
.withLaunchSpecifications(launchSpec)
.withAllocationStrategy(AllocationStrategy.LowestPrice)
.withTargetCapacity(targetCapacity)
.withType(FleetType.Maintain)
.withClientToken(spotFleetToken);
RequestSpotFleetRequest request = new RequestSpotFleetRequest()
.withSpotFleetRequestConfig(config);
RequestSpotFleetResult result = ec2.requestSpotFleet(request);
LOG.info("Created spot fleet request with ID {}", result.getSpotFleetRequestId());
Changing or removing the tags doesn't work either, the error persists no matter what. Does anyone have a clue what I am doing wrong?
It seems like the documentation was a bit confusing. It mentions that ResourceType is not required, but I had to set it explicitly to instance to successfully create my SpotFleetRequest.

Unparsable MOF Query When Trying to Register Event

Update 2
I accepted an answer and asked a different question elsewhere, where I am still trying to get to the bottom of this.
I don't think that one-lining this query is the answer, as I am still not getting the required results (and multi-lining queries is allowed in .mof, as shown in the URLs in comments to the answer ...
Update
I rewrote the query as a one-liner as suggested, but still got the same error! As it was still talking about lines 11-19 I knew there must be another issue. After saving a new file with the change, I reran mofcomp and it appears to have loaded, but the event which I have subscribed to simply does not work.
I really feel that there is not enough documentation on this topic and it is hard to work out how I am meant to debug this - any help on this would be much appreciated, even if this means using a different more appropriate method.
I have the following .mof file, which I would like to use to register an event on my system :
#pragma namespace("\\\\.\\root\\subscription")
instance of __EventFilter as $EventFilter
{
Name = "Event Filter Instance Name";
Query = "Select * from __InstanceCreationEvent within 1 "
"where targetInstance isa \"Cim_DirectoryContainsFile\" "
"and targetInstance.GroupComponent = \"Win32_Directory.Name=\"c:\\\\test\"\"";
QueryLanguage = "WQL";
EventNamespace = "Root\\Cimv2";
};
instance of ActiveScriptEventConsumer as $Consumer
{
Name = "TestConsumer";
ScriptingEngine = "VBScript";
ScriptText =
"Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n"
"Set objFile = objFSO.OpenTextFile(\"c:\\test\\Log.txt\", 8, True)\n"
"objFile.WriteLine Time & \" \" & \" File Created\"\n"
"objFile.Close\n";
// Specify any other relevant properties.
};
instance of __FilterToConsumerBinding
{
Filter = $EventFilter;
Consumer = $Consumer;
};
But whenever I run the command mfcomp myfile.mof I am getting this error:
Parsing MOF file: myfile.mof
MOF file has been successfully parsed
Storing data in the repository...
An error occurred while processing item 1 defined on lines 11 - 19 in file myfile.mof:
Error Number: 0x80041058, Facility: WMI
Description: Unparsable query.
Compiler returned error 0x80041058
This error appears to be caused by incorrect syntax in the query, but I don't understand where I have gone wrong with this - is anyone able to advise?
There are no string concatenation or line continuation characters being used in building "Query". To keep it simple, you could put the entire query on one line.

Null Reference Excepion when saving data on subsonic 3

I am testing subsonic 3, i can query my database but when i am inserting a record i have an exception. Here is my code:
Client lClient = new Client();
lClient.Name = "Peter";
lClient.FullName = "Richards";
lCliente.Save();
And i have a null reference exception on this generated code:
var newKey=_repo.Add(this,provider);
Any help is appreciated.
I am using ActiveRecords
I had a similar problem, with code not unlike the following:
var pending = myTable.SingleOrDefault(x => x.Id == 1);
if (pending == null)
pending = new myTable();
pending.Id = 1;
pending.MyDate = DateTime.Now;
pending.MyString = someString;
pending.Save();
This worked the first time I ran it, on an empty table, but not the second time when updating. I got a nullreference exception somewhere inside the subsonic repository. The solution was to add a primary key, as Rob suggested.
Just thought I'd mention it (thanks Rob).
Where does the null reference exception actually happen? Is _repo null?
Try and double check that you don’t have any columns in the “Client” table which are not nullable and you don’t set any value.
Also make sure you PK is handled correctly (check you have the [Property.IsForeignKey=true;] attribute)
Do you have NullReferenceException Checked in (file menu) Debug -> Exceptions (press Find and type NullReferenceException, press OK)?
I downloaded the SubSonic code and used it as reference for my project, the exception is thrown in SubSonic.Core\Repository\SubSonicRepository.cs:209 because prop is not checked for null at line 208, and any exceptions are swallowed as evidenced by line 213.
What happens is visual studio breaks on all the exceptions checked in the mentioned dialog. So in one way, this is the expected behaviour from the code.
What actually causes prop to become null, in my case, the table field name is lower-case, but the property is actually cased properly.
From Immediate:
tbl.PrimaryKey.Name
"playerinformationid"
item.GetType().GetProperties()
{System.Reflection.PropertyInfo[11]}
[0]: {System.Collections.Generic.IList`1[SubSonic.Schema.IColumn] Columns}
// *snip*
[5]: {Int32 PlayerInformationid}
// *snip*
item.GetType().GetProperty("PlayerInformationid")
{Int32 PlayerInformationid} // Works!
item.GetType().GetProperty(tbl.PrimaryKey.Name)
null
I hacked this together to "just make it work" (Warning: newbie at 3.5 stuff)
-var prop = item.GetType().GetProperty(tbl.PrimaryKey.Name);
+var lowerCasedPrimaryKeyName = tbl.PrimaryKey.Name.ToLowerInvariant();
+var prop = item.GetType().GetProperties().First<System.Reflection.PropertyInfo>(x => x.Name.ToLowerInvariant() == lowerCasedPrimaryKeyName);
Does your table have a PrimaryKey? It doesn't sound like it does. If not - this is your problem.