Programming Leftovers
-
Danylo Piliaiev: Command stream editing as an effective method to debug driver issues
In previous posts, “Graphics Flight Recorder - unknown but handy tool to debug GPU hangs” and “Debugging Unrecoverable GPU Hangs”, I demonstrated a few tricks of how to identify the location of GPU fault.
But what’s the next step once you’ve roughly pinpointed the issue? What if the problem is only sporadically reproducible and the only way to ensure consistent results is by replaying a trace of raw GPU commands? How can you precisely determine the cause and find a proper fix?
Sometimes, you may have an inkling of what’s causing the problem, then and you can simply modify the driver’s code to see if it resolves the issue. However, there are instances where the root cause remains elusive or you only want to change a specific value without affecting the same register before and after it.
The optimal approach in these situations is to directly modify the commands sent to the GPU. The ability to arbitrarily edit the command stream was always an obvious idea and has crossed my mind numerous times (and not only mine – proprietary driver developers seem to employ similar techniques). Finally, the stars aligned: my frustration with a recent bug, the kernel’s new support for user-space-defined GPU addresses for buffer objects, the tool I wrote to replay command stream traces not so long ago, and the realization that implementing a command stream editor was not as complicated as initially thought.
-
Bálint Réczey: Building the Linux kernel in under 10 seconds with Firebuild
Russell published an interesting post about his first experience with Firebuild accelerating refpolicy‘s and the Linux kernel‘s build. It turned out a few small tweaks could accelerate the builds even more, crossing the 10 second barrier with Linux’s build.
Build performance with 18 cores
The Linux kernel’s build time is a widely used benchmark for compilers, making it a prime candidate to test a build accelerator as well. In the first run on Russell’s 18 core test system the observed user+sys CPU time was cut by 44% with an actual increase in wall clock time which was quite unusual. Firebuild performed much better than that in prior tests. To replicate the results I’ve set up a clean Debian Bookworm VM on my machine: [...]
-
Zig Bits 0x2: Using defer to defeat memory leaks
Let's talk about how to detect memory leaks in Zig and avoid them by using the
defer
statement. -
Continuing on API Endpoint Documentation for Package and File Sources
You might have been already using our new openAPI Documentation. We now want to let you know we added some more documentation about package endpoints and we added the new section about file endpoints. You can check them out below! Sources - Packages Sources - Files After kicking off the API documentation remake in January 2021, we’ve continued with the Build and Workers endpoints in April 2021, we followed with Sources Projects and Search endpoints...
-
WebAssembly enables Fermyon to deliver serverless architecture that executes at sub 1 millisecond speeds
-
How can I refresh a page with jQuery
Refreshing a page is a common task in web development, and it can be accomplished easily with jQuery. Whether you need to update content, reset form fields, or trigger a new request to the server, jQuery offers a variety of methods to refresh a page.
-
String Obfuscation: Character Pair Reversal, (Tue, Mar 21st)
I found a malicious .LNK file on MalwareBazaar that contains an obfuscated URL. The obfuscation is a classic one, with a twist: string reversal, not per character, but per character pair.
-
Fixing QtKeychain freezing on Apple devices [Ed: Wasting KDE time... on Apple devices]
Working on the Nextcloud desktop client, I stumbled into a nasty little bug. If you tried to add or remove a user account, the app would often freeze for a while.
-
Caolán McNamara: GTK 4.10 and LibreOffice accessibility
Towards GTK 4.10 some of the functionality to integrate LibreOffice's internal accessibility support with GTK has been exposed. Some experimenting this week with GTK trunk gives me the above, writer's document accessibility hierarchy integrated with the GTK one.
Very little actually works, but a working base to start from.
-
XOR Two Strings in Python
The “ord()” function converts string values into their ASCII representatives and passes to XOR. “^” operator returns the difference of converted ASCII values.
-
Sort Nested List in Python
In Python, “sort()” and “sorted()” methods sort a nested list in ascending, descending order, based on the index of a tuple or with respect to length.
-
Python Do While Loops
In Python, there is no construct defined for do while loop.
-
How to Convert String to JSON in Python
In Python, JSON (JavaScript Object Notation) is a commonly used data format for exchanging data between applications. JSON data is represented as a string in Python, but sometimes it's necessary to convert that string into a JSON object to work with it more effectively.
-
What are the Python Static Variables
Python is a popular high-level programming language, known for its simplicity, versatility, and ease of use. One of the useful features of Python is the ability to define static variables. In this article, we will discuss what are static variables in Python and provide some examples.
-
GET and POST requests using Python
HTTP (Hypertext Transfer Protocol) is a protocol that allows data communication on the web. It uses various methods to transfer data between the client and the server. Two of the most commonly used methods are GET and POST.
-
GET and POST requests using Python
In today's world, web applications and APIs play a significant role in data exchange and communication. We often need to send HTTP requests such as GET and POST to interact with these web services.
-
Qt Digital Advertising in Toradex's Torizon [Ed: Qt brags about putting ads inside user interfaces, even if users do not want these]
Monetizing your embedded devices can seem like a daunting challenge at first. With the large variety of ad networks and technologies, plus the uncertainty of support for various hardware platforms, it might not seem worth the effort. However, serving ads on embedded devices running Qt has never been easier with Qt Digital Advertising and Toradex's Torizon.
-
What exactly is a unified LPWAN and why do we want one?
This is the year of the Low-Power Wide-Area Network (LPWAN). And much like in home or even industrial networks, where multiple wireless protocols cozy up to one another, when it comes to blanketing large areas with low data-rate connectivity, users will have several options to choose from.