View on GitHub

Quorten Blog 1

First blog for all Quorten's blog-like writings

When OpenCL is not available on Raspberry Pi 4, you can use OpenGL 3.0 ES compute shaders instead. Yeah, sure. But, driver issues aside, what really is the difference between OpenCL and OpenGL compute shaders? Mainly, the purpose of using OpenGL compute shaders is to integrate general purpose GPU compute into an existing, predominantly graphics application. OpenGL compute shaders have easier access to OpenGL state, but OpenCL needs state synchronization primitives and such.

Also, I found a little bit of useful information about how to use OpenGL compute shaders.

20200623/DuckDuckGo opengl compute shader
20200623/https://www.khronos.org/opengl/wiki/Compute_Shader
20200623/DuckDuckGo compute shaders versus opencl
20200623/https://stackoverflow.com/questions/15868498/what-is-the-difference-between-opencl-and-opengls-compute-shader

In the course of finishing up my blog article on parallel compute primitives, I had a lot of great ideas to write down in the reflection conclusion, but after further thought about the general direction I wanted that blog article to go, I decided that it would be better to leave those out to a separate blog article. Again, they’re all very good ideas worth reflecting on.

  • Reflection on the typical structure of libraries. Typically, most popular software libraries are “hand-hacked” optimized toward a particular set of assumptions, and naturally, these assumptions are never quite general enough.

  • And why is this? Well, as I can punctually testify from my experience of writing up this more general code, there’s simply less things the human programmer needs to keep track of!

  • And indeed, it is very much close to the metal. Very much like assembly language programming. The classic tenets of assembly language source code you’ve seen in the 80’s and 90’s graphics programming, complete replete reproduction in a more modern environment.

  • The tendency of game programmers is to hand-hack things up to only target a very specific set of circumstances, often time computer hardware trends of the time. And then the software would not work on my computer, it always required some special feature or function that was only available on newer computers. Why?

Read on →

Why does it not make sense to use a power series to evaluate a polynomial? Here I copy my explanation that I started writing elsewhere but edited out because this should be obvious to the mathematically inclined.

The power rule is the principle means of differentiation on polynomials, but can we compute this in parallel? Let’s see if we can reformulate this.

f(x) = c*x^y
f'(x) = c*y*x^(y - 1)
f''(x) = c*y*(y - 1)*x^(y - 2)
f^(n)(x) = c * P(y, n) * x^(y - n)
P(n, r) = n! / (n - r)!

So, here’s the trick with power series on polynomials. Permutations can be computed in parallel by virtue of computing factorials in parallel. Ideally, we can leverage our need to compute a factorial sequence in parallel to generate a factorial lookup table and simply use that when computing permutations. But, why are you computing a power series to approximate a polynomial when you can just evaluate the polynomial directly? Look at what happens in the big picture of the overall equation!

Read on →

Again, I reiterate, because this is important!

The few computing platforms that have changed our lives.

In hindsight, too often it feels companies or developer communities are off to a good start building a platform, “a world,” but then they tend to hit a ceiling and it all turns out to be just a box.

So pretty soon we look around outside the box and find that other boxes that are much bigger. But by then, the magic is gone. They are each just disparate boxes, it’s not the full outside world where there is no ceiling.

Apple II, Macintosh, Windows, they all had their highs and lows but none of them really stuck for the long haul as a platform. Rather, the best ideas were jury-rigged into the next new platform that claimed no continuity with the last.

This is a great LetGrow article on the things you can do with silica gel moisture desiccant packets. It also includes a very important caution: do not use packets that have colored dyes to indicate how much moisture they have absorbed because the dye is typically a carcinogen.

20200618/https://letgrow.org/silica-gel-packets/

Wondering about the equivalent of cuBLAS for OpenCL? CLBlast is the nearest match, clBLAS is also available but not as performant. The “t” is for tuned.

20200618/https://github.com/CNugteren/CLBlast
20200618/https://github.com/clMathLibraries/clBLAS

Vulkan is not yet available for Raspberry Pi 4, but OpenGL ES 3.1 Compute Shaders are available, so you can use this in the intermin.

20200618/https://blogs.igalia.com/itoral/2020/01/17/raspberry-pi-4-v3d-driver-gets-opengl-es-3-1-conformance/

Interesting article about comparing human longevity versus life expectancy between the past and the present. Longevity apparently hasn’t changed very much, it’s all in life expectancy: the hazards that would cut human lives short in the old days were much greater.

Yes, intuitively I have generally believed this to be the case, and that the correct way to interpret the general situation.

20200618/https://getpocket.com/explore/item/do-we-really-live-longer-than-our-ancestors

Electronics rare earth metals, what byproducts do the manufacturers produce and what is the impact on the environment? The environmental impact is a hefty one. Take for example Cerium and Neodymium. These are rather abundant metals, but China produces 90% of them, even though they only have 30% of the earth’s reserves. Why? Purportedly, nobody else is willing to pay the environmental price required for the techniques that are used to refine them. This involves crushing and dissolving in sulfuric acid on an industrial scale, and it produces a considerable amount of toxic byproduct.

Something to think about if you are designing electronics with rare earth metals.

20200617/https://getpocket.com/explore/item/the-dystopian-lake-filled-by-the-world-s-tech-lust

Also, please note the interior factory pictures. The paint on the wall looks all bent up, there is an odly placed fan? Look, the answers are obvious right here. The refining chemicals are caustic and the strip the paint right off the walls and ceiling. AND, by using only cheap means of air movement, without proper filtration and purification, unlike in Western industrial electroncis manufacturing environments, the chemicals have no impedance to do their damage. Imagine what all that exposure is doing to the workers themselves? Sad but true.

Here are yet more Golang Meetup notes… sort of.

Here we have yet another gigantic DDoS attack that have happened on the Internet in recent times. You’d think by now we’d be better about mitigating these kinds of things in a much better way, but, well, they’re still happening, and our mitigation techniques have not really improved.

20200617/https://www.zdnet.com/article/aws-said-it-mitigated-a-2-3-tbps-ddos-attack-the-largest-ever/

What was the source vulnerability that was exploited? CLDAP servers, being run by companies as a more convenient and simpler LDAP for various doodads.

Concourse build result visualization? It’s like Drone, but better. Well, then I really have to check it out.

20200629/https://concourse-ci.org/

This is a related convenience library.

20200629/https://github.com/digitalocean/concourse-resource-library

Oh, and the name of the game in this presentation? Go COP, or new name to be determined. A great test sysstem for managing flaky tests in a large Golang project, used by a particular team at Digital Ocean.

Read on →

OpenCL on Raspberry Pi 4? Surely there’s some info out there, isn’t there? Well, yes. Now, here’s the trick. Although Raspberry Pi 4 doesn’t support OpenCL (yet), support for Vulkan is planned. Vulkan on Raspberry Pi 4? Awesome! Why, that’s even better than OpenCL support. It’s not out and about yet… purportedly it is 6 months of development before they release an initial version. Also, Vulkan very much relies on 64-bit support, so a 64-bit OS is a must to support Vulkan. Which, fortunately, Raspberry Pi 4 does have official support out and about.

20200625/DuckDuckGo raspberry pi 4 opencl
20200625/https://stackoverflow.com/questions/58693978/opencv-3-4-opencl-on-raspberrypi-4-gpu
20200625/https://github.com/doe300/VC4CL/issues/86
20200625/DuckDuckGo raspberry pi 4 vulkan
20200625/https://www.raspberrypi.org/blog/vulkan-raspberry-pi-first-triangle/