GPU sharing

Posted on Fri 05 April 2024 in Nvidia, GPU, Kubernetes • Tagged with Nvidia, GPU, Kubernetes

I've found this interesting post from 2022 by Nvidia about GPU sharing in Kubernetes.

The main GPU sharing technologies can be summarized in this table:

Technology Description MicroArchitecture CUDA Version
CUDA Streams Allows concurrent operations within a single CUDA context using software abstraction. Pascal and later Not specified
Time-Slicing Oversubscription strategy using the GPU's time-slicing scheduler. Pascal and later 11.1 (R455+ drivers)
CUDA MPS MPS (Multi-Process Service) enables concurrent processing of CUDA kernels from different processes, typically MPI jobs. Not specified 11.4+
MIG MIG (Multi-Instance GPU) is a secure partitioning of GPUs into separate instances for dedicated resources. Ampere Architecture Not specified
NVIDIA vGPU Provides VMs with simultaneous, direct access to a single physical GPU. Compatible with MIG-supported GPUs Not specified

The post also explains how GPUs are advertised as schedulable resources in Kubernetes with the device plugin framework, but it is a integer-based resource, so it does not allow for oversuscription. They describe a way of achieving this with time-slicing APIs.


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.