In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
#!/usr/bin/env python3 | |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. | |
import math | |
import numpy as np | |
from typing import Tuple | |
import torch | |
import torch.nn.functional as F | |
from pytorch3d.transforms import Rotate, Transform3d, Translate |
from graphviz import Digraph | |
from torch.autograd import Variable | |
import torch | |
def make_dot(var, params=None): | |
if params is not None: | |
assert isinstance(params.values()[0], Variable) | |
param_map = {id(v): k for k, v in params.items()} |
import os | |
import torch | |
import argparse | |
from maskrcnn_benchmark.config import cfg | |
from maskrcnn_benchmark.utils.c2_model_loading import load_c2_format | |
def removekey(d, listofkeys): | |
r = dict(d) | |
for key in listofkeys: |
# from: http://blender.stackexchange.com/questions/40650/blender-camera-from-3x4-matrix?rq=1 | |
# And: http://blender.stackexchange.com/questions/38009/3x4-camera-matrix-from-blender-camera | |
# Input: P 3x4 numpy matrix | |
# Output: K, R, T such that P = K*[R | T], det(R) positive and K has positive diagonal | |
# | |
# Reference implementations: | |
# - Oxford's visual geometry group matlab toolbox | |
# - Scilab Image Processing toolbox |
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 |
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=1.8 |
from timeit import default_timer as time | |
import numpy as np | |
from numba import cuda | |
import os | |
os.environ['NUMBAPRO_LIBDEVICE']='/usr/lib/nvidia-cuda-toolkit/libdevice/' | |
os.environ['NUMBAPRO_NVVM']='/usr/lib/x86_64-linux-gnu/libnvvm.so.3.1.0' | |
import numpy | |
import torch | |
import ctypes |
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.
The basic idea is that C:\Program Files\Git\mingw64\
is your /
directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git
, the mingw64
in this directory is your root. Find it by using pwd -W
).
If you go to that directory, you will find the typical linux root folder structure (bin
, etc
, lib
and so on).
If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so