Skip to content

Instantly share code, notes, and snippets.

View morgangiraud's full-sized avatar
🚤
Drowning under all the innovations flooding ML

Morgan Giraud morgangiraud

🚤
Drowning under all the innovations flooding ML
View GitHub Profile
@morgangiraud
morgangiraud / tinygrad-p2p-patched-driver.sh
Created May 2, 2024 11:56
tinygrad-p2p-patched-driver.sh
# this GIST is a follow-up to this previous GIST: https://gist.github.com/morgangiraud/ffa45e76b6891cd4e37e90d75b8be37b
# See the article here: https://morgangiraud.medium.com/multi-gpu-nvidia-p2p-capabilities-and-debugging-tips-fb7597b4e2b5
# It provides some tips and tricks to install Tinygrad patched nvidia open kernel to give P2P capabilities
# to the 40** series!
### Transitioning into complex operations, our aim is to minimize potential issues.
### Important: Verify that the version from nvidia-smi matches exactly what we intend to use.
### At the time of this writing, the reported version is 550.78.
@morgangiraud
morgangiraud / multi-gpu.sh
Last active June 19, 2024 09:13
Script for Ubuntu: Nvidia Multi-GPU Installation and Testing
# Script for Ubuntu: Nvidia Multi-GPU Installation and Testing (Adaptable for other distros)
# Step 0: Clean Nvidia Installation
# If you need to completely remove a previous Nvidia installation, use these commands.
# This ensures that you start with a clean slate for a new installation.
sudo apt-get --purge remove "*nvidia*"
sudo apt-get --purge remove "*cuda*" "*cudnn*" "*cublas*" "*cufft*" "*cufile*" "*curand*" "*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*" "*libnccl*"
# Verify that the removal is complete by checking if any Nvidia, CUDA, or cuDNN packages are still installed.
apt list --installed | grep cuda
@morgangiraud
morgangiraud / isArgentWallet.js
Last active October 19, 2022 09:13
How to check if an address is from argent without relying on the argentWalletDetector function
// https://docs.argent.xyz/wallet-connect-and-argent#wallet-detection
import { ethers } from "ethers";
const RPCProviderURL = "";
const argentWalletAddr = "";
// https://etherscan.io/address/0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8#code
const argentDetectorAddr = "0xeca4B0bDBf7c55E9b7925919d03CbF8Dc82537E8";
(async () => {
@morgangiraud
morgangiraud / keybase.md
Created September 12, 2019 14:07
keybase.md

Keybase proof

I hereby claim:

  • I am morgangiraud on github.
  • I am morgangiraud (https://keybase.io/morgangiraud) on keybase.
  • I have a public key whose fingerprint is 9D2A 048C EED6 6145 DCAB C207 7820 6527 07D0 11E3

To claim this, I am signing this object:

@morgangiraud
morgangiraud / convertSVGToPNG.sh
Created March 5, 2018 10:35
convert SVG to PNG in current folder - one liner
for f in *.svg; do convert -density 1200 -resize 1000x1000 $f ${f%%.*}.png;done
@morgangiraud
morgangiraud / clean-aws-audio.sh
Last active October 23, 2017 13:07
Clean audio files coming from aws
mkdir -p tmp/out && cd tmp
aws s3 sync --profile myprofile s3://my-bucket/my-folder .
for f in *; do ffmpeg -i "$f" -vn -ar 44100 -ac 2 -ab 192k -f mp3 "out/tmp-$f"; done;
cd out && rename 's/tmp-//' *
# Beware, this line erase the original files
# aws s3 sync --profile myprofile . s3://my-bucket/my-folder
@morgangiraud
morgangiraud / sync.sh
Created February 8, 2017 09:33
.bashrc functions to synchronize the current folder to/from the server using rsync
synctoserver() {
rsync -Pav -e 'ssh -i mykey.pem' "$PWD" [email protected]:rsync/.
}
syncfromserver() {
rsync -Pav -e 'ssh -i mykey.pem' [email protected]:rsync/${PWD##*/}/. .
}
@morgangiraud
morgangiraud / nvidia-reinstall.sh
Last active December 11, 2020 15:48
Script to reinstall manually nvidia drivers,cuda 9.0 and cudnn 7.1 on Ubuntu 16.04
# Remove anything linked to nvidia
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
# Search for your driver
apt search nvidia
# Select one driver (the last one is a decent choice)
sudo apt install nvidia-370
@morgangiraud
morgangiraud / example.sh
Last active July 21, 2016 08:54
Handling disk and filesystem on ubuntu
# List all block device with diverse information
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
# Managing partition
sudo fdisk /dev/sdx # MBR mode, the old way. Can't handle more than 2T
sudo gdisk /dev/sdx # the new way
# Format the drive with the filesystem type you want
# This is when a UUID is created
sudo mkfs -t ext4 /dev/sdx
@morgangiraud
morgangiraud / Dockerfile
Created July 20, 2016 12:38
Dockerfile tensorflow built from source cuda:7.5-cudnn5
FROM nvidia/cuda:7.5-cudnn5-devel
MAINTAINER Craig Citro <[email protected]>, Morgan Giraud <[email protected]>
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
libfreetype6-dev \
libpng12-dev \