Skip to content

Instantly share code, notes, and snippets.

@fadenb
fadenb / gc-nixos-infect-via-startup_script.sh
Created March 21, 2021 09:48
Spin up a Genesis Cloud CPU instance and transform it with nixos-infect into a NixOS system. (example for nixos.wiki)
#!/usr/bin/env nix-shell
#! nix-shell -p jq -p bash -i bash
# Notes:
# Replace <MY TOKEN> with your API token
# Replace <NICKNAME> with the nickname of your instance
# Replace <HOSTNAME> with the hostname of your instance
# `vcpu-8_memory-16g_disk-80g` indicates the instance type; See https://developers.genesiscloud.com/instances#instance-types for details
# `6d5c3613-f6cb-48e1-8711-14f084060209` is the ID for the current default Ubuntu 16.04 image. Image IDs can be queried via the API: https://developers.genesiscloud.com/images#list-images
# `2b7ab082-e9f2-40f0-a410-a6337b6a6d42` is the ID for my previosly configured SSH pubkey. Key IDs can be queried via the API: https://developers.genesiscloud.com/ssh-keys#list-ssh-keys
@ArseniyShestakov
ArseniyShestakov / gpu-hotplug.md
Last active May 3, 2024 05:54
Current QEMU dual-VM configuration. Thanks to everyone who helped me!

Check it's working

DRI_PRIME=1 glxinfo | grep OpenGL

Unbind AMD GPU from Radeon driver

echo "1002 6719" > /sys/bus/pci/drivers/vfio-pci/new_id echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind echo "0000:01:00.0" > /sys/bus/pci/drivers/vfio-pci/bind echo "1002 6719" > /sys/bus/pci/drivers/vfio-pci/remove_id echo "1002 aa80" > /sys/bus/pci/drivers/vfio-pci/new_id echo "0000:01:00.1" > /sys/bus/pci/devices/0000:01:00.1/driver/unbind