Skip to content

Instantly share code, notes, and snippets.

View kba's full-sized avatar

Konstantin Baierer kba

View GitHub Profile
@aelkiss
aelkiss / mets1to2.xsl
Last active September 11, 2023 20:37
Transformation from METS1 to METS2
moved to https://github.com/mets/METS1to2
@bertsky
bertsky / cudatest.sh
Last active June 10, 2023 23:51
OCR-D workflow for coverage tests, esp. CUDA support
set -e
# select first CUDA device (in case there are multiple, which may fail due to [a recent Tensorflow problem](https://github.com/qurator-spk/eynollah/issues/99))
export CUDA_VISIBLE_DEVICES=0
# check we are not running into [this bug](https://github.com/shapely/shapely/issues/1598)
python3 -c "from shapely.geometry import Polygon; import torch; torch.randn(10).cuda()"
# validate CUDA support is working in TF and Torch (not an exhaustive test)
python3 -c "import torch; print(torch.cuda.is_available())"
@bertsky
bertsky / plot-cuda-util.sh
Last active May 26, 2026 17:01
Plot GPU compute and memory utilization curve
#!/usr/bin/env bash
fname=$1
# if the log file does not exist yet, record it (stop by pressing ctrl+c)
if ! test -f $fname; then
nvidia-smi -f $fname -l 1 --format=csv --query-gpu=timestamp,memory.total,memory.used,utilization.gpu,utilization.memory &
bg=$!