Skip to content

Instantly share code, notes, and snippets.

View ugovaretto's full-sized avatar

Ugo Varetto ugovaretto

View GitHub Profile
@ugovaretto
ugovaretto / grub
Created August 23, 2025 13:40
Kernel parameters to use all the GPU memory on Strix Halo
#/etc/default/grub
#run sudo grub2-mkconfig -o /boot/grub2/grub.cfg after changing the file
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
##### vvvvvvvvvvvvvvv
GRUB_CMDLINE_LINUX="rhgb quiet amd_iommu=off amdgpu.gttsize=131072 ttm.pages_limit=33554432"
##### ^^^^^^^^^^^^^^^
@ugovaretto
ugovaretto / ollama-gfx1151.diff
Last active August 19, 2025 07:39
Fix to make ollama work with gfx1151 with 128GB GTT Memory
diff --git a/discover/amd_linux.go b/discover/amd_linux.go
index ebffbdf6..bbb5ec49 100644
--- a/discover/amd_linux.go
+++ b/discover/amd_linux.go
@@ -315,15 +315,15 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) {
gpuOrdinalID += 1
// iGPU detection, remove this check once we can support an iGPU variant of the rocm library
- if totalMemory < IGPUMemLimit {
- reason := "unsupported Radeon iGPU detected skipping"
@ugovaretto
ugovaretto / link-bitcode.sh
Created August 14, 2025 05:29
link bitcode files
@ugovaretto
ugovaretto / link-all.sh
Created July 24, 2025 10:17
Link all files in a target path to files in the current directory
@ugovaretto
ugovaretto / launch-vllm.sh
Last active August 27, 2025 12:37
Run vLLM on gfx1151
#!/bin/env bash
# Launch VLLM on a gfx1151 AMD Strix Halo 395+
# As of August 27, 2025
podman run -it --rm --ipc=host --network=host --privileged \
--cap-add=CAP_SYS_ADMIN \
--device=/dev/kfd --device=/dev/dri --device=/dev/mem \
--group-add render \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
-e HSA_OVERRIDE_GFX_VERSION=11.0.0 \
@ugovaretto
ugovaretto / tmux-session.sh
Created July 23, 2025 05:48
Persist and restore tmux sessions
#!/usr/bin/env bash
# Save and restore the state of tmux sessions and windows.
# TODO: persist and restore the state & position of panes.
# https://github.com/mislav/dotfiles/blob/d2af5900fce38238d1202aa43e7332b20add6205/bin/tmux-session
set -e
dump() {
local d=$'\t'
tmux list-windows -a -F "#S${d}#W${d}#{pane_current_path}"
}
@ugovaretto
ugovaretto / tmux.conf
Last active July 21, 2025 08:21
TMUX config
# Rebind Prefix to CTRL-S
set-option -g prefix C-s
unbind C-b
bind C-a send-prefix
# Vim navigation
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
@ugovaretto
ugovaretto / Dockerfile
Created June 29, 2025 14:42
Dockerfile for AI webscraping with crawl4AI and Playwright
# crawl4ai and playwright
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y \
python3 \
python3-pip
WORKDIR /app
RUN apt install -y build-essential
@ugovaretto
ugovaretto / gpumem.sh
Created June 25, 2025 03:38
Chagne memory assigned to GPU on Apple silicon
sudo sysctl debug.iogpu.wired_limit=26624
@ugovaretto
ugovaretto / venv.txt
Created June 7, 2025 09:02
Add virtual env information to Oh my Posh prompt
Past the following in the "segments" section of the theme's JSON file:
{
"background": "#FFDE57",
"foreground": "#111111",
"powerline_symbol": "\ue0b0",
"properties": {
"display_mode": "environment",
"fetch_virtual_env": true,
"home_enabled": true
},