Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kmhofmann's full-sized avatar

Michael Hofmann kmhofmann

View GitHub Profile
@kmhofmann
kmhofmann / installing_nvidia_driver_cuda_cudnn_linux.md
Last active March 8, 2024 19:42
Installing the NVIDIA driver, CUDA and cuDNN on Linux

Installing the NVIDIA driver, CUDA and cuDNN on Linux (Ubuntu 20.04)

This is a companion piece to my instructions on building TensorFlow from source. In particular, the aim is to install the following pieces of software

on an Ubuntu Linux system, in particular Ubuntu 20.04.

@kmhofmann
kmhofmann / init.vim
Created February 29, 2020 13:38
vim-lsp-cxx-highlight issue demonstration
" Bootstrap vim-plug automatically, if not already present
let s:vim_plug_autoload_file = '~/.config/nvim/autoload/plug.vim'
if empty(glob(s:vim_plug_autoload_file))
execute "!curl -fLo " . s:vim_plug_autoload_file . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
endif
set encoding=utf8
set ffs=unix,dos,mac
syntax enable
set background=dark
@kmhofmann
kmhofmann / # ruby - 2018-10-20_08-41-55.txt
Created October 20, 2018 06:50
ruby on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for ruby on macOS 10.13.6
Build date: 2018-10-20 08:41:55
@kmhofmann
kmhofmann / # ruby - 2018-10-19_07-26-22.txt
Created October 19, 2018 05:43
ruby on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for ruby on macOS 10.13.6
Build date: 2018-10-19 07:26:22
@kmhofmann
kmhofmann / bootstrap_deb.sh
Created April 27, 2018 14:52
A shell script to bootstrap tmux and nvim installation on Debian-like systems (e.g. RPi).
#!/usr/bin/env bash
#
# Bootstrapping some tools for Debian-like systems,
# e.g. Raspberry Pis running Raspbian, etc.
#
sudo apt-get install wget curl git build-essential python-pip python3-pip vim \
cmake ninja-build libtool libtool-bin autoconf automake cmake g++ \
pkg-config unzip texinfo libevent-dev libncurses-dev
#! /usr/bin/env bash
# A small script to choose one of more existing Python virtualenvs,
# inside $HOME/.virtualenvs. This script needs to be sourced.
function venv_activate {
source $1/bin/activate
}
function venv_deactivate {
@kmhofmann
kmhofmann / tmux_howto.md
Last active August 23, 2022 09:25
tmux HOTWO

tmux HOWTO

tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal, and a lot more.

  • The tmux manpage (man tmux) or the printed copy of the tmux book near the team's library are great resources on using tmux.
    This HOWTO just lists the most useful commands.
  • Despite tmux being a very powerful tool, the default configuration of tmux is not the most user friendly.
    I am maintaining a tmux configuration file that makes life a bit easier here:
    https://github.com/kmhofmann/dotfiles
    The HOWTO is written assuming this configuration file (or one with similar mappings) is installed.
@kmhofmann
kmhofmann / building_tensorflow.md
Last active March 2, 2024 18:37
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht