Skip to content

Instantly share code, notes, and snippets.

@klueska
klueska / Dockerfile.sandbox-gpu-test
Last active September 10, 2026 09:20
Dockerfile.sandbox-gpu-test
# Reproduction image for the sandbox-gpu-cdi-support branch's real-hardware GPU tests.
#
# Stage 1 builds runsc (gVisor) from source instead of using the prebuilt release
# binary from storage.googleapis.com/gvisor. Why: gVisor checks the *runtime* host's
# page size against a Go constant baked in at *compile* time (unix.Getpagesize() vs.
# hostarch.PageSize in runsc/cmd/sentry/sentrycmd/boot.go) and fatals on a mismatch in
# either direction. The prebuilt aarch64 release binary is compiled for 4K pages only
# (pkg/hostarch/hostarch_arm64.go's default), which hard-fails on ARM64 hosts whose
# kernel boots with 64K pages (e.g. NVIDIA Grace/GB200 -- NVIDIA recommends 64K there
# for HBM throughput, even though most distros default to 4K and the silicon supports
package api
import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
DevMgmtAPIVersion = "devmgmtproto.k8s.io/v1alpha1"
)
@klueska
klueska / nodeResourceSlice.go
Created February 12, 2024 10:24
NodeResourceSliceSpec
package main
import (
semverv4 "github.com/blang/semver/v4"
"k8s.io/apimachinery/pkg/api/resource"
)
type NodeResourceSliceSpec struct {
// NodeName identifies the node where the capacity is available.
// A field selector can be used to list only NodeResources
diff --git a/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go b/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go
index cea6317257e..bdec8984139 100644
--- a/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go
+++ b/pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go
@@ -44,10 +44,9 @@ func (s *server) RegisterPlugin(pluginName string, endpoint string, versions []s
func (s *server) DeRegisterPlugin(pluginName string) {
klog.V(2).InfoS("Deregistering plugin", "plugin", pluginName)
- s.mutex.Lock()
- defer s.mutex.Unlock()
# Run the export command of nvidia-mig-parted
nvidia-mig-parted export
# Show nvidia-smi on the host with 8 full GPUs
nvidia-smi -L
# List out the NVIDIA container toolkit packages installed
dpkg -l | grep nvidia-container; dpkg -l | grep nvidia-docker
# Show that docker is configured to run with the nvidia container toolkit
layout blog
title Kubernetes Topology Manager Moves to Beta - Align Up!
date 2020-03-30
slug kubernetes-1-18-feature-topoloy-manager-beta

Authors: Kevin Klues (NVIDIA), Victor Pickard (RedHat), Conor Nolan (Intel)

This blog post describes the TopologyManager, a beta feature of Kubernetes in release 1.18. The TopologyManager feature enables NUMA alignment of CPUs and peripheral devices (such as SR-IOV VFs and GPUs), allowing your workload to run in an environment optimized for low-latency.

--- blog-orig.md 2020-03-31 13:06:09.899071690 +0200
+++ blog.md 2020-03-31 13:04:49.594078489 +0200
@@ -7,46 +7,52 @@
**Authors:** Kevin Klues (NVIDIA), Victor Pickard (RedHat), Conor Nolan (Intel)
-This blog post describes the **<code>TopologyManager</code>**, a beta feature of Kubernetes in release 1.18. The <strong><code>TopologyManager</code></strong> feature enables NUMA alignment of CPUs and peripheral devices (such as SR-IOV VFs and GPUs), allowing your workload to run in an environment optimized for low-latency.
+This blog post describes the **<code>TopologyManager</code>**, a beta feature of Kubernetes in release 1.18. The **<code>TopologyManager</code>** feature enables NUMA alignment of CPUs and peripheral devices (such as SR-IOV VFs and GPUs), allowing your workload to run in an environment optimized for low-latency.
-Prior to the introduction of the **<code>TopologyManager</code>**, the CPU and Device Manager would make resource allocation decisions independent of each other. This could resu
#!/usr/bin/env bash
# Declare some helper functions
function get_kubernetes_hostname() {
local json="$(kubectl get nodes -o json)"
echo ${json} | python -c "$(cat << EOF
import sys
import json
nodes = json.load(sys.stdin)
import itertools
import prettytable
from prettytable import PrettyTable
affinities = [
(0,1),
(1,0),
(1,1),
]
$ mesos --help
Mesos CLI
Usage:
mesos (-h | --help)
mesos --version
mesos <command> [<args>...]
Options:
-h --help Show this screen.