How GPGPU came to exist

Posted on Tue 05 March 2024 in GPGPU, CUDA, Nvidia, GPU • Tagged with GPGPU, CUDA, Nvidia, GPU

I've been reading about the history of GPU computing in chapter 2 of "Massively Parallel Processors" by David B. Kirk and Wen-mei W. Hwu. It's a fascinating story of how the GPU came to be used for general-purpose computing.

The story begins in the 1990s, when the first consumer 3D graphics cards were being developed. These cards were designed to accelerate the rendering of 3D graphics for video games. They were able to do this by offloading the rendering work from the CPU to the GPU, which was specifically designed for this task.

The first GPUs were fixed-function, meaning that they could only perform a limited set of operations. However, as the demand for more realistic and complex graphics grew, the capabilities of the GPU were expanded. This led to the development of programmable shaders, which allowed developers to write custom code to control the rendering process. In the beginning, these shaders were still limited to graphics-related tasks and there were different kinds, such as vertex shaders and pixel shaders.

One of the questions I …


Continue reading

Llamafile: the easiest way to try LLMs locally

Posted on Mon 01 January 2024 in AI, LLM • Tagged with AI, LLM

From my previous post about projects to test AI chat bots locally, the field has not been standing still.

I've found that the easiest way to try LLMs locally is to use llamafile: download a file, run it and that's it.

I've also tried LM studio, which is more powerful, but it's also more complicated to use.


Uninstalling Windows Apps that seem not to be installed

Posted on Mon 01 January 2024 in Windows • Tagged with Windows

I found with WizTree that there are some apps in C:\Program Files\WindowsApps that seem not to be installed for my user, and I'm the only user on my computer. Examples are games like Candy Crush and Disney Magic Kingdoms. I found a solution to uninstall them in the following thread.

Basically, you have to start PowerShell as administrator and run the following command:

Get-AppxPackage -allusers  *disney* | Select Name, PackageFullName
Get-AppxPackage -allusers  *disney* | Remove-AppxPackage -allusers

The first command lists all apps that contain the string disney in their name. The second command removes all apps that contain the string disney in their name. You can also use *candy* to remove Candy Crush and so on.


Serving JavaScript with Python's http.server

Posted on Wed 19 July 2023 in Python, JavaScript, Web • Tagged with Python, JavaScript, Web

I was trying to serve a JavaScript file with Python's http.server module, but I was getting this error:

Loading module from http://localhost:9876/main.js” was blocked because of a disallowed MIME type (“text/plain”).

I saw in this StackOverflow answer that I needed to change the MIME type for JavaScript files. I'm using Windows, so I checked the key HKEY_CLASSES_ROOT\.js in RegEdit, and I found that it had this value:

(Default)     JSFile
ContentType   text/plain
PerceivedType text

I changed the ContentType to application/javascript, and now my JavaScript files are served with the correct MIME type.

I'm not sure why the MIME type was set to text/plain in the first place. I'm guessing that it was set by a program that I installed, but I don't know which one. I'm also not sure if changing the MIME type will cause any problems with other programs.


Pylance and mypy cannot find editable local imports

Posted on Thu 01 June 2023 in Pylance, Mypy, Python • Tagged with Pylance, Mypy, Python

The other day, I wrote a post about how I fixed a problem with Pylance not finding a local import. It worked, but now mypy was complaining about the same import.

The solution was installing the package in compat mode with:

pip install -e . --config-settings editable_mode=compat