Vulkan fails to load layer library - c

I am using MoltenVK on MacBook Air with Apple Silicon. I have set my environment according to instructions on Vulkan Tutorial website but when I try to run my program in Xcode I get the following two error messages from validation layer:
ERROR (Callback: Validation Layer): Loading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_api_dump.dylib
ERROR (Callback: Validation Layer): Loading layer library /usr/local/share/vulkan/explicit_layer.d/../../../lib/libVkLayer_khronos_validation.dylib
I have played around with the settings in vkconfig and added environment variable VK_INSTANCE_LAYERS pointing to list of those two layers that failed to load and VK_LAYER_PATH that points to path /Users/jakub/VulkanSDK/1.3.224.1/macOS/share/vulkan/explicit_layer.d. None of that worked.

Those environment variables only work on macOS if you launch the apps from the command line. Apple does not allow environment variables to be set for GUI apps launched from the desktop, etc. A better way to use layers on macOS is to use VKConfig. You can create a configuration with the layers you want (and there's a nice GUI for tweaking layer parameters). This creates a "metalayer" that the loader will always see and make use without the need for environment variables. Also, make sure you do not link statically to MoltenVK, as this does not use the actual loader and layers will not work (although linking statically is perfectly fine for shipping your apps).

Related

WebkitGtk application is not loading file URL

I am building a kiosk application using webkitgtk on the raspberry pi 4.
This application will not be connected to the internet and all the html,css, javascript for the UI are all located on the local filesystem.
I am using buildroot to setup the Linux system, starting with the pi 4 defconfig provided in buildroot.
I have enabled all the packages needed to get webkitgtk running.
Also, the kiosk application has been tested on my desktop, using the same software stack and it works
However, when i try to launch the application on the raspberry pi, a blank page pops up. I have played around with the WebKitWebSettings object associated with my WebKitWebView by enabling local file access. It still shows up a blank screen.
Also included in my pi4 application bundle is a simple gtk3+ application. This launches successfully!
I will really appreciate some pointers as to why this is happening as i have sort of reached a dead end
UPDATE
I enabled the MiniBrowser app that comes with the Webkitgtk package.
Entering the local url, The page does not load. It only gives me a message at the top saying "Successfully downloaded".
It seems to be treating my input as a download
UPDATE 2
After some more experimenting, i was finally able to get webkitgtk working on the pi 4.
The problem seems to originate from using the webkit_web_view_load_uri() api.
It does not seem to recognize my html document as a web page.
I got around it using the webkit_web_view_load_html() call. This included some hacks by first reading in the contents of the html doc into a character buffer, and passing it to webkit_web_view_load_html().
You also have to provide a base path to this function call to be able to resolve all the urls (scripts, css, images etc) in your html document.
Another problem i haven't been able to work around is, SVG images are not loading in webkitgtk. I have used jpg formats and they work. I suspect this my be due to a configuration switch in building webkigtk
It's hard for me to figure out what might be happening without having access to your environment and settings. My gut feeling is that pages are showing blank because perhaps some shared libraries are missing. You can check that with:
$ ldd WebKitBuild/GTK/Release/bin/MiniBrowser
I am using buildroot to setup the Linux system, starting with the pi 4 defconfig provided in buildroot.
There's a buildroot repository for building WPE for RPi. WPE (WebPlatform for Embeded) is like WebKitGTK but doesn't depend on GTK toolkit. Another important difference is that WPE runs natively on Wayland.
If you're interested in having a webapp embedded in a browser running in a device with limited capabilities, WPE is a better choice than WebKitGTK. The buildroot repo for building WPE for RPi is here:
https://github.com/WebPlatformForEmbedded/buildroot
There's is also this very interesting step-by-step guide on how to build WPE for RPi3:
https://samdecrock.medium.com/building-wpe-webkit-for-raspberry-pi-3-cdbd7b5cb362
I'm not sure whether the buildroot recipe would work for RPi4. It seems to work for all previous versions, so you might be stepping in new land if you try to build WPE on RPi4.
If you have an RPi3 available I'd try to build WPE for RPi3 first, and make sure that works. Then try for RPi4.

VXWorks Simulation not re-building kernel source code

Working off of the sample ball Downloadable Kernel Module Project in VXWorks6.9.4.12 Workbench3.3 given in this guide (http://www.cs.utep.edu/isalamah/courses/5372/WR-WB-UserGuide.pdf) on a vxsimulator target with the full network stack setting.
Trying to change the kernel source code (trying the reset some network components or even just cause a syntax error in the file /vxworks/components/ip_net2-6.9/vxux/daemon/daemon.c), I've noticed that no changes/recompilation takes place even after rebuilding a project or launching a new workbench, and that all the includes for the Kernel Module Project are .h files (for which some depend on the changed deamon.c).
The changes saved from the workbench are showing when I access the files from the command line but the syntax errors added are not stopping TCP code from running properly--any guidance on how to either make these changes take effect or how to go about making changes for a simulator target.
What you are trying to do is to recompile the source of VxWorks itself. This has to be done thru a VxWorks Source Build Project. This is well documented on docs.windriver.com; for example: Configuring and Building the VxWorks Source Build Project.

How to debug C and Matlab code at the same time?

I have some Matlab .m files that use a C function I've created.
When Debugging in Matlab, or Visual-Studio, is there any way to run step by step both C and Matlab codes in a way that both Matlab a C variables remain usable for debug?
This addresses only the MSVS half of your question...
The steps to use step-by-step debugging using Visual Studio are outlined here. This is just an except centering around a .dll that is hosted by a pre-existing application. Matlab qualifies as a host application, whether it is also being run in debug mode, or not.
Start debugging from the calling app
The app that calls a DLL can be:
An app from a Visual Studio project in the same or a different solution from the DLL.
An existing app that is already deployed and running on a test or production computer.
Located on the web and accessed through a URL.
A web app with a web page that embeds the DLL.
To debug a DLL from a calling app, you can:
Open the project for the calling app, and start debugging by selecting Debug > Start Debugging or pressing F5.
or
Attach to an app that is already deployed and running on a test or production computer. Use this method for DLLs on websites or in web
apps. For more information, see How to: Attach to a running process.
Before you start debugging the calling app, set a breakpoint in the
DLL. See Using breakpoints. When the DLL breakpoint is hit, you can
step through the code, observing the action at each line. For more
information, see Navigate code in the debugger.
During debugging, you can use the Modules window to verify the DLLs
and .exe files the app loads. To open the Modules window, while
debugging, select Debug > Windows > Modules. For more information, see
How to: Use the Modules window. Use the Immediate window
You can [also] use the Immediate window to evaluate DLL functions or methods
at design time. The Immediate window plays the role of a calling app.
[and so on....]

Debugging & profiling a runtime-loaded module

I need to load and run a C module using dlopen() / LoadLibrary(), and be able to review extensive profiling & debugging information of the hosted module only (not the host program), via a live log displayed as part of the host:
How exactly would I go about extracting stack state and profiling info from the hosted module, at runtime? gprof and gdb? And doing so without slowing things down awfully?
Could any of the debugging and profiling information that comes back, be mixed up (i.e. between host and hosted), provided that I compile both the host and hosted modules with the correct, respective compiler switches? I need a completely clean separation of log data i.e. just the hosted module.

Attempting to load a DLL on Windows using LoadLibrary when a dependent DLL is missing

I have an application that uses LoadLibrary on Windows to dynamically load plugins. However some of the plugins have other dependent DLLs, such as database client DLLs.
When you attempt to load such a DLL and one of the dependent DLLs doesn't exist you get a nasty Windows dialog:
"The program can't start because xxx.ddl is missing from your computer. Try reinstalling the program to fix this problem."
Is there any easy way to avoid this dialog? I was hoping one could use LoadLibraryEx and pass a flag that says "don't give me that annoying dialog", but it doesn't seem like it.
What I'd like is for the application to handle that error, rather than Windows handling it for me, especially as the text of the message is incorrect (the problem isn't that the program can't start, the program is running quite happily, it just can't load this plugin).
What I'd like to avoid is having to rewrite the plugins that have these external dependencies to make them themselves do a dynamic load of any dependent modules and then query for any entry points.
Anyway, any suggestions would be gratefully received.
Use SetErrorMode(). Use it with SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS before you load the DLL and with 0 right after.
From MSDN:
To enable or disable error messages displayed by the loader during DLL loads, use the SetErrorMode function.
Link here

Resources