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.
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.
'use strict'; | |
////////////////////////////////// | |
// How to use? | |
// 1. Create `sequelize-schema-file-generator.js` in your app root | |
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders). | |
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports) | |
// 4. Run it with `node sequelize-schema-file-generator.js` | |
// 5. Review the generated migrations inside of the `migrations` folder. | |
////////////////////////////////// |
import os | |
import tensorflow as tf | |
trained_checkpoint_prefix = 'checkpoints/dev' | |
export_dir = os.path.join('models', '0') # IMPORTANT: each model folder must be named '0', '1', ... Otherwise it will fail! | |
loaded_graph = tf.Graph() | |
with tf.Session(graph=loaded_graph) as sess: | |
# Restore from checkpoint | |
loader = tf.train.import_meta_graph(trained_checkpoint_prefix + '.meta') |
""" | |
Adapted from https://github.com/Vetal1977/tf_serving_example/blob/master/svnh_semi_supervised_client.py | |
""" | |
# -*- coding: utf-8 -*- | |
import time | |
from argparse import ArgumentParser | |
import numpy as np |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import logging | |
from flask import Flask, request, jsonify | |
from flask_cors import CORS, cross_origin | |
from translate_client import Server |
#One workaround is to create clone environment, and then remove original one: | |
#(remember about deactivating current environment with deactivate on Windows and source deactivate on macOS/Linux) | |
conda create --name new_name --clone old_name --offline #use --offline flag to disable the redownload of all your packages | |
conda remove --name old_name --all # or its alias: `conda env remove --name old_name` | |
#There are several drawbacks of this method: | |
# time consumed on copying environment's files, | |
# temporary double disk usage. |
# https://github.com/HDFGroup/hdf5/blob/hdf5-1_13_1/release_docs/INSTALL_parallel | |
# https://docs.olcf.ornl.gov/software/python/parallel_h5py.html | |
# https://www.pism.io/docs/installation/parallel-io-libraries.html | |
# using ~/local/build/hdf5 as the build directory. | |
# Install HDF5 1.13.1 with parallel I/O in ~/local/hdf5, | |
version=1.13.1 | |
prefix=$HOME/local/hdf5 | |
build_dir=~/local/build/hdf5 | |
hdf5_site=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13 |
""" | |
Creates an HDF5 file with a single dataset of shape (channels, n), | |
filled with random numbers. | |
Writing to the different channels (rows) is parallelized using MPI. | |
Usage: | |
mpirun -np 8 python demo.py | |
Small shell script to run timings with different numbers of MPI processes: |
I wrote these instructions as part of "installing PyTorch with CUDA 12.1.1".
Anyway, if you still need to compile from source… here's how:
This is a dependency of PyTorch, which is sensitive to CUDA version.
Clone Magma:
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git | |
cd nv-codec-headers | |
vi Makefile # change the first line to PREFIX = ${CONDA_PREFIX} | |
make install | |
cd .. | |
git clone https://git.ffmpeg.org/ffmpeg.git | |
cd ffmpeg | |
git checkout n4.2.2 | |
conda install nasm |