Skip to content

Instantly share code, notes, and snippets.

View wbuchwalter's full-sized avatar
🦙

William Buchwalter wbuchwalter

🦙
View GitHub Profile
import numpy as np
from os import listdir
from os.path import isfile, isdir, join
import os
import json
import random
import re
cwd = os.getcwd()
cwd = os.getcwd()
import pdb
import time
import argparse
import os
import csv
import json
from urllib.request import urlopen
from multiprocessing import Pool
import numpy as np
# CALL WITH:
import argparse
from shared_code.custom_datasets import test_new_stuff
parser = argparse.ArgumentParser()
parser.add_argument('i', type=int, help='GPU Index')
parser.add_arguments('s', type=int, help='dataset size')
args = parser.parse_args()
import argparse
import os
import csv
import json
from urllib.request import urlopen
from multiprocessing import Pool
import numpy as np
parser = argparse.ArgumentParser()
def get_outputs_path(default):
try:
from polyaxon_helper import get_outputs_path
out = get_outputs_path()
if out is not None:
return out
except ImportError:
return default
#!/bin/sh
apt-get update && apt-get install -y linux-headers-$(uname -r) gcc make
rmmod nouveau
sh -c "echo \"blacklist nouveau\" >> /etc/modprobe.d/blacklist.conf"
update-initramfs -u
NVIDIA_DRIVERS_INSTALL_DEST="/usr/local/nvidia"
# Create the destination directory and move there
mkdir -p "${NVIDIA_DRIVERS_INSTALL_DEST}"
cd "${NVIDIA_DRIVERS_INSTALL_DEST}"
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
spec:
template:
metadata:
labels:
apiVersion: batch/v1
kind: Job
metadata:
name: nvidia-smi
spec:
template:
metadata:
name: nvidia-smi
spec:
restartPolicy: Never
import pykube
import os
import json
def main():
kubeconfig = '/root/.kube/config'
if os.path.isfile(kubeconfig):
# for using locally
api = pykube.HTTPClient(
apiVersion: v1
kind: ConfigMap
metadata:
name: tf-job-operator-config
namespace: default
data:
controller_config_file.yaml: |
accelerators:
alpha.kubernetes.io/nvidia-gpu:
envVars: