Skip to content

Instantly share code, notes, and snippets.

Avatar

LiberiFatali

  • Vietnam
View GitHub Profile
@LiberiFatali
LiberiFatali / intel-nvidia-offload-rendering.md
Created Sep 20, 2022 — forked from haipnh/intel-nvidia-offload-rendering.md
Intel for display, NVIDIA for computing and offload rendering
View intel-nvidia-offload-rendering.md

Purposes

  1. iGPU will be used for main display and rendering daily-use softwares in default
  2. Dedicated GPUs will be used for computing or offload rendering
  3. Reduce the used VRAM of Dedicated GPU, which is mostly used for X11 server rendering

Tested Hardware Configuration

OS: Ubuntu 18.04.4 LTS
Mainboads
├── iGPU
@LiberiFatali
LiberiFatali / intel-nvidia.md
Created Sep 20, 2022 — forked from wangruohui/intel-nvidia.md
Intel for display, Nvidia for computing
View intel-nvidia.md

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
View triple-birthday-problem.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View install-cuda-10-bionic.sh
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && sudo apt update
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
View search_without_index.py
import numpy as np
import faiss
def search_knn(xq, xb, k, distance_type=faiss.METRIC_L2):
""" wrapper around the faiss knn functions without index """
nq, d = xq.shape
nb, d2 = xb.shape
assert d == d2
@LiberiFatali
LiberiFatali / su.py
Created Feb 7, 2018 — forked from pebbie/su.py
Implementation of document binarization algorithm by (Bolan Su et al, 2010)
View su.py
"""
author: Peb Ruswono Aryan
Binarization Algorithm by Su et al.
@inproceedings{Su:2010:BHD:1815330.1815351,
author = {Su, Bolan and Lu, Shijian and Tan, Chew Lim},
title = {Binarization of Historical Document Images Using the Local Maximum and Minimum},
booktitle = {Proceedings of the 9th IAPR International Workshop on Document Analysis Systems},
series = {DAS '10},