In the name of God
This gist contains steps to setup Ubuntu 22.04
for deep learning.
import torch | |
from torch.utils._python_dispatch import TorchDispatchMode | |
from torch.utils._pytree import tree_map | |
import itertools | |
# cribbed from https://github.com/albanD/subclass_zoo/blob/main/logging_mode.py | |
class Lit: | |
def __init__(self, s): | |
self.s = s |
import torch | |
import torch.utils.dlpack | |
import jax | |
import jax.dlpack | |
# A generic mechanism for turning a JAX function into a PyTorch function. | |
def j2t(x_jax): | |
x_torch = torch.utils.dlpack.from_dlpack(jax.dlpack.to_dlpack(x_jax)) | |
return x_torch |
#!/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 |
# tips from Ben Lindsay: http://benjlindsay.com/blog/running-jupyter-lab-remotely/ | |
# This function does a few things when you type jllocal: | |
# Runs ssh tunneling command if it's not already running | |
# Grabs the Jupyter token from the remote machine | |
# Opens a tab in your browser with the right url and token for you | |
# When you're done with Jupyter Lab, you just type jllocal kill and it will shut down the ssh connection. | |
function jllocal { |
# WARNING: These steps seem to not work anymore! | |
#!/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 |
### Install Box2D from source | |
# Mac | |
brew install swig | |
# Linux | |
sudo apt-get install build-essential python-dev swig | |
# Download source | |
cd ~/dev |
cmake_minimum_required(VERSION 3.5.1) | |
project(matrix_demo) | |
find_package(catkin REQUIRED | |
rospy | |
roscpp | |
std_msgs | |
) | |
include_directories( |
To remove a submodule you need to: