View on GitHub

Quorten Blog 1

First blog for all Quorten's blog-like writings

Okay, okay, so I thought it would be awesome to have a good CPU framebuffer graphics rendering library, but it turned out that’s not enough for me. Why? Well, the justification is a little bit difficult to explain, but in a few words, the motivation will be obvious. When you use OpenCL on classic VidCore IV Raspberry Pi platforms, it ties up the GPU and needs exclusive, non-shared, uninterrupted access to it. Yeah, like many things on Raspberry Pi, the same can be said about the accelerated SPI display output library. This means that you cannot use the Mesa VC4 driver at the same time, so that means OpenGL cannot be used for graphics rendering in an OpenCL application. And no, VidCore IV is not good enough to support OpenGL ES 3.1, so no Compute Shaders extension is remotely on the radar for support either.

So… if you’re creating an OpenCL accelerated application, and you need 3D graphics rendering capabilities at the same time, what is the solution? Well, if you already have your own OpenCL 3D graphics rendering library, this problem is a piece of cake to solve. So, now that the justification is obvious, how do I approach the conversion to parallel on the code I have so far?

Read on →

Wow, issues of abuse from men CEOs? Why all the injustice. Surely, women CEOs would make a difference. But alas… at the end of this experimental trial period, we’ve found out pretty much what we already knew of men CEOs. They too can be “snakes in suits,” the sociopaths in disguise among the business elite.

20200625/https://gen.medium.com/the-end-of-the-girlboss-is-nigh-4591dec34ed8

Great white sharks feat orcas

2020-06-26

Categories: random  
Tags: random  

Wow, this is interesting. When ocras come, great white sharks flee. Why? On an incidental occasion, an orca will attack a great white shark, and this otherwise fearsome predator becomes prey.

An orca, then, is an apex predator’s apex predator. No wonder sharks flee from them. But orcas don’t actually have to kill any great whites to drive them away. Their mere presence–and most likely their scent–is enough.

20200623/https://getpocket.com/explore/item/the-predator-that-makes-great-white-sharks-flee-in-fear

This is a great article recounting several astronauts specific words about what they felt when they went up in space, what kind of mental transformation happened when they saw the space-bound view of Earth. Suddenly, they’re home is Earth, not just one part of Earth, any people in different countries that they’ve never even been to neighbors and friends alike. Aboard the International Space Station, the experience is really transformative to be eating a meal with astronauts from different countries, over the course of which the Station flies over each one of their own countries so fast.

20200625/https://getpocket.com/explore/item/six-nasa-astronauts-describe-the-moment-in-space-when-everything-changed

UPDATE: Non-pocket URL:

20200923/https://www.inverse.com/article/42902-nasa-astronauts-describe-overview-effect-everything-changed

How do those ribbon cables that connect LCDs work? Sure, if you’re having trouble with missing pixels on a character or numeric style LCD, you know the ribbon cable to the circuit board is connected with hot glue, so it’s merely a matter of reheating with a hot air gun and pressing down with a pencil eraser (be careful with the abrasive!) to seal it back down to a nice connection. But what exactly are all the materials?

The Wikipedia articles are only vaugely informative, they lack any photos that look consistent with what I’ve been looking at.

20200625/https://en.wikipedia.org/wiki/Liquid-crystal_display
20200625/https://en.wikipedia.org/wiki/Tape-automated_bonding
20200625/https://en.wikipedia.org/wiki/Elastomeric_connector
20200625/https://en.wikipedia.org/wiki/Anisotropic_conductive_film

After searching on Digi-Key, I got some hints. What I’m looking for is called a “heat seal.” Going back to the Wikipedia articles, indeed, I found a word-drop of “heat seal connector,” so I search for that, and tada! I found lots of great technical information. Unfortunately, Digi-Key appears not to sell the bare LCD modules where you must attach the heat seal connectors yourself.

Read on →

C++ operator overloading makes it really easy to write generalized math code. Just change the type declarations on your variables, and tada! You can go from using machine integers to bugnums. But simpler programming languages like C do not have operator overloading. Besides implementing a parser front-end to rewrite your code, how else can you achieve similar effects in C?

The solution is simple though mundane. Rewrite all your math code so that it looks like it’s working with bignums all the time. Rather than using infix notation with arithmetic operators, you use function call notation everywhere. Here’s a simple example.

a = b + c;
#define ADD2_NUM(b, c) ((b) + (c))
#define ADD3_NUM(a, b, c) ((a) = ADD2((b), (c)))

Since we otherwise would have two identical macro names for the two variants, we add a number to the name indicating how many arguments the macro takes. The two-argument form passes the result as a return value, the other writes its output to an argument, and also makes it available as a return value. If b and c are passed by value, a is also passed by value. The rule is that all arguments are either passed by value or passed by reference for consistency.

Read on →

This is a very insightful article on Raspberry Pi OpenGL driver development. Unfortunately, due to the advent of the Raspberry Pi 4 and its incompatible VidCore VI GPU, development effort has shifted away from VidCore IV.

20200624/DuckDuckGo raspberry pi v3d mesa
20200624/https://noise.getoto.net/2019/10/11/vc4-and-v3d-opengl-drivers-for-raspberry-pi-an-update/

But, the point of my original search I wanted to bring up. The name of the Mesa 3D driver is VC4 for early Raspberry Pi computers and V3D for Raspberry Pi 4. Remember that. And remember, unfortunately, you cannot run both OpenCL and OpenGL at the same time on the older Raspberry Pi computers. Yep… so if you want software that lets you use both at once, you have to use Raspberry Pi 4, simply because software for the alternative path hasn’t been developed and it looks like there might not be enough momentum to develop it.

In the meantime, you must use OpenGL ES 3.1 compute shaders on Raspberry Pi 4, Vulkan is still in development and a few months out.

I’ve defined the high-level concepts behind a powerful, generalized parallel compute library, designed to make it easy to take advantage of GPU parallel compute capabilities.

But, how much does GPU parallel compute capabilities actually buy you? In the process of writing complex software, typically you will start… by just having a ton of programmers write a ton of code, in whatever programming language that is convenient for them to write the code as quickly as possible to get working code, regardless of the speed or efficiency of the code. Typically, this means the ability to take advantage of GPU parallel compute capabilities is completely thrown out the window, with the exception of areas in the code where the programmers decided to use someone else’s library whole for high-level operations.

So, really, if you have any random software like this and you go about asking the question, how far can you go with GPU parallel compute optimization?

Read on →

What are some of the existing GPU regular expression matching libraries that are out and about? Um fortunately, there aren’t really that many ones out there, not to mention that the few that are out there aren’t all that great. The first option only works on Nvidia GPUs due to the use of CUDA, the second is far less developed, not to mention that the first one is already rather but an incomplete proof of concept.

20200623/DuckDuckGo opencl regular expression
20200623/http://bkase.github.io/CUDA-grep/finalreport.html
20200623/https://github.com/crepererum/oclgrep

Another interesting thing I found along the way. I learned OpenCL by reading the OpenCL 1.0 specification, in addition to reading the CUDA documentation. But, for those who were not initiated along this learning path, here is an alternative educational history you can follow. This is a great set of slides for learning OpenCL, hands-on as they tout.

20200623/https://www.nersc.gov/assets/pubs_presos/MattsonTutorialSC14.pdf

OpenModelica revisited

2020-06-23

Categories: media-prog  
Tags: media-prog  

OpenModelica is a good framework for physics simulation, so I am told. So I revisit it, in the year 2020, and the result… looks like the website hasn’t been updated in years! Argh… the style looks just the same as the last time I visited years ago, which although it looked fairly modern back then on the old computer I was viewing it from, times have changed around the website, but the site itself has not.

Well, anyways, the main question I had on my mind in relation to OpenModelica was, what is its GPU compute acceleration support? Unfortunately, looks like it has no such support. Tough luck, it only transcodes to C code, but has no special provisions for generating OpenCL code.

20200623/https://www.openmodelica.org/developersresources/devdocumentation
20200623/https://en.wikipedia.org/wiki/OpenModelica
20200623/https://en.wikipedia.org/wiki/Modelica

Nevertheless, because it is an old software thing after all, it is used by a lot of old-time players like car companies. And… now here’s the thing. For the Modelica model description language on its own, there is a whole host of proprietary implementations, some of which may indeed have GPU computer acceleration support.