Skip to content

Instantly share code, notes, and snippets.

@MihailCosmin
MihailCosmin / cuda_11.8_installation_on_Ubuntu_22.04
Last active May 18, 2024 22:39 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@kieber-emmons
kieber-emmons / ParallelRadixSort.metal
Last active February 6, 2024 10:24
This gist is for an article I wrote on Medium (https://medium.com/p/4f4590cfd5d3).
//
// ParallelRadixSort.metal
//
// Created by Matthew Kieber-Emmons on 08/29/22.
// Copyright © 2022 Matthew Kieber-Emmons. All rights reserved.
// This work is for educational purposes only and cannot be used without consent.
//
#include <metal_stdlib>
using namespace metal;
@victor-shepardson
victor-shepardson / pytorch-glumpy.py
Last active March 25, 2024 19:47
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
from contextlib import contextmanager
import numpy as np
import torch
from torch import Tensor, ByteTensor
import torch.nn.functional as F
from torch.autograd import Variable
import pycuda.driver
from pycuda.gl import graphics_map_flags
from glumpy import app, gloo, gl
@ilkinulas
ilkinulas / logcat_unity.py
Last active November 8, 2022 19:18
Formats unity (adb) logcat logs
#!/usr/bin/python
#
# Usage:
# adb logcat -v time | python logcat_unity.py
import sys
import re
IGNORED_LINES=["(Filename:"]
LOG_TAG="Unity"
@Mischa-Alff
Mischa-Alff / fps.cpp
Last active January 26, 2023 04:12
std::chrono::high_resolution_clock::time_point start, end, timetoprint;
timetoprint = start = end = std::chrono::high_resolution_clock::now();
long long frame_count=0;
long double frametime_total=0.f;
while(!glfwWindowShouldClose(win)) {
end = std::chrono::high_resolution_clock::now();
long int frametime_us = (std::chrono::duration_cast<std::chrono::microseconds>(end-start).count());
float frametime_s = ft/1e6f;