cd $CAFFE_ROOT
./data/cifar10/get_cifar10.sh
./examples/cifar10/create_cifar10.sh
./examples/cifar10/train_quick.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/sbin/modprobe nvidia | |
if [ "$?" -eq 0 ]; then | |
# Count the number of NVIDIA controllers found. | |
NVDEVS=`lspci | grep -i NVIDIA` | |
N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l` | |
NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!TEX program = xelatex | |
% Font Size: | |
% 10pt, 11pt, 12pt | |
% Paper Size: | |
% a4paper, letterpaper, a5paper, leagalpaper, executivepaper, landscape | |
% Font Family: | |
% roman, sans | |
\documentclass[12pt, a4paper, roman]{moderncv} | |
% Style: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/mman.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <string.h> | |
#define STORAGE_ID "/SHM_TEST" | |
#define STORAGE_SIZE 32 | |
int main(int argc, char *argv[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# the following must be performed with root privilege | |
helpFuction() | |
{ | |
echo "" | |
echo "Usage: $0 device_id" | |
echo -e "\t device_id is the id of nvidia device from what nvidia-smi displays" | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NVCC=/usr/local/cuda/bin/nvcc | |
LIBS=-lcuda | |
INCLUDE=~/NVIDIA_CUDA-9.1_Samples/common/inc | |
all:main | |
threadMigration_kernel64.ptx:threadMigration_kernel.cu | |
$(NVCC) -ptx -o $@ $< $(LIBS) -arch=sm_35 | |
main:threadMigration.cpp | |
$(NVCC) $(LIBS) -I $(INCLUDE) -o threadMigration threadMigration.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./t1034 & | |
./t1034 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
avg_time() { | |
# usage: avg_time n command ... | |
# | |
n=$1; shift | |
(($# > 0)) || return | |
for((i = 0; i < n; i++)); do | |
{ time -p "$@" &>/dev/null; } 2>&1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
POSIX: | |
gcc -std=gnu99 -o mmap_shm mmap_shm.c -lrt | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
After setting BIOS with "software controlled" option, try to enable SGX in software opt-in way. | |
The source code comes from https://github.com/intel/linux-sgx/issues/238#issuecomment-377324381. | |
I just compile and execute it. | |
Note that: replace the path with your own, run it with root permission, then reboot the machine | |
gcc -o sgx_enable sgx_enable.c -I /home/max/data/gitroom/linux-sgx/common/inc/ -L /home/max/data/gitroom/linux-sgx/build/linux/ -lsgx_capable | |
sudo ./sgx_enable | |
sudo reboot |
OlderNewer