Skip to content

Instantly share code, notes, and snippets.

@nanom1t
nanom1t / pitcairn_linux_clock_fix.md
Created May 5, 2021 07:15 — forked from Francesco149/pitcairn_linux_clock_fix.md
Gain massive GPU performance for Southern Islands AMD GPUs on Linux by removing DPM quirks in the kernel

Gain massive GPU performance for Southern Islands AMD GPUs on Linux by removing DPM quirks in the kernel

I recently found out that my r9 270x GPU was not hitting full clock speeds because it was being throttled by the kernel based on old bug reports on DPM stability. This was an easy fix on gentoo where recompiling the kernel is trivial, but on ubuntu and similar, rebuilding the kernel is not so straightforward, so here's a guide based on ubuntu 16.04 LTS. If you run gentoo or know what you're doing you can just skip to the relevant code.

On my r9 270x, this resulted in an overall improvement in frame-rates of up to 50%: Unigine Valley went from something like 30-40 fps average to 55-60 and osu! (running in wine) went from 0.33 ms (~3000fps) to 0.25ms (~4000fps).

Note that I'm no linux god and all this info was pieced together by googling and asking on forums (credits to the guys at phoronix for pointing me to the quirks code).

If you're using the proprietary amdgpu-pro driver, read until the end of the

@nanom1t
nanom1t / AMDGPUOC.sh
Created May 1, 2021 12:20
AMD GPU scripts for Linux, one to overclock, one to get stats on the GPU. Written for my Vega 64
#!/bin/bash
<<LICENSE
Copyright (C) 2018-2019 kevinlekiller
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@nanom1t
nanom1t / wifi-on-ubuntu-server-18.md
Created February 25, 2021 12:42 — forked from austinjp/wifi-on-ubuntu-server-18.md
Enabling wifi on Ubuntu server 18

Wifi on Ubuntu 18 server

TLDR

  1. Install wpasupplicant
  2. Turn on wifi radios: sudo nmcli radio wifi on
  3. Check your devices are recognised even if they're not "managed": sudo iwconfig
  4. Check your wifi (here called "wlp3s0") is capable of detecting nearby routers: sudo iwlist wlp3s0 scan
  5. Configure netplan by dropping a file called 01-netcfg.yaml into /etc/netplan/ or edit existing file there. See example below.
  6. netplan try, netplan generate, netplan apply.
@nanom1t
nanom1t / authserver.go
Created January 15, 2021 10:12 — forked from elithrar/authserver.go
HTTP Basic Auth example in Go (based on http://stackoverflow.com/a/21937924/556573 + bespoke middleware implementation)
package main
import (
"encoding/base64"
"github.com/gorilla/mux"
"net/http"
"strings"
)
func main() {
@nanom1t
nanom1t / IAPHelper.txt
Created October 22, 2020 08:03 — forked from mitchellporter/IAPHelper.txt
In App Purchase in Swift, with Receipt Validation
import UIKit
import StoreKit
//MARK: SKProductsRequestDelegate
extension IAPHelpers : SKProductsRequestDelegate
{
func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse)
{
@nanom1t
nanom1t / auth.go
Created January 21, 2020 18:54
Golang basic auth example
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
@nanom1t
nanom1t / nvidia.sh
Created December 26, 2019 08:12 — forked from ironicbadger/nvidia.sh
nvidia linux overclocking for crypto mining
#!/bin/bash
#nvidia-xconfig --allow-empty-initial-configuration --enable-all-gpus --cool-bits=28 --separate-x-screens
nvidia-smi -pm ENABLED
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
#!/bin/bash
#set persistence mode for all GPU
sudo nvidia-smi -pm 1
#Set gpu max power at 160w
sudo nvidia-smi -pl 160
#Set Power level of specific GPU (1080) in watts
# sudo nvidia-smi -i 2 -pl 200
@nanom1t
nanom1t / set_smi_power_limit_nvidia.md
Created December 25, 2019 18:50 — forked from abelardojarab/set_smi_power_limit_nvidia.md
Set and get power limit under Linux for NVIDIA cards

Get device numbers

$ nvidia-smi -L
GPU 0: GeForce GTX 1070 (UUID: GPU-2a97b3b6-2318-aa98-f163-d164eb9d54fd)
GPU 1: GeForce GTX 1070 Ti (UUID: GPU-d2085209-9bc9-f2ac-9983-dd7b4a0627dd)
GPU 2: TITAN Xp COLLECTORS EDITION (UUID: GPU-1334cd53-38d9-7e44-4634-6e8290de0795)

Set maximum power limit