Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
import torch as T | |
import numpy as np | |
import tqdm | |
import pickle | |
device = T.device('cpu') | |
horizon = 8 | |
ndim = 2 |
#!/bin/bash | |
set -e | |
# OPTIONAL: zsh will not install without ncurses. IF your machine doesn't have ncurses, you need to install it first. | |
export CXXFLAGS=" -fPIC" CFLAGS=" -fPIC" CPPFLAGS="-I${HOME}/include" LDFLAGS="-L${HOME}/lib" | |
wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz | |
tar -xzvf ncurses-6.2.tar.gz | |
cd ncurses-6.2 | |
./configure --prefix=$HOME --enable-shared |
Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
#!/usr/bin/env python | |
'''Crop an image to just the portions containing text. | |
Usage: | |
./crop_morphology.py path/to/image.jpg | |
This will place the cropped image in path/to/image.crop.png. | |
For details on the methodology, see |
#!/bin/bash | |
# install CUDA Toolkit v8.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-get update | |
sudo apt-get -y install cuda |
# modified from https://gist.github.com/sorenbouma/6502fbf55ecdf988aa247ef7f60a9546 | |
import gym | |
import numpy as np | |
import matplotlib.pyplot as plt | |
env = gym.make('CartPole-v0') | |
env.render(close=True) | |
#vector of means(mu) and standard dev(sigma) for each paramater | |
mu=np.random.uniform(size=env.observation_space.shape) | |
sigma=np.random.uniform(low=0.001,size=env.observation_space.shape) |
$ uname -r
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.