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
# Script to detect bank conflicts in Thread Group Shared Memory | |
# Supports optional Multicast (default: On), variable wave (default: 32) and bank count (default: 32) | |
# bank_conflicts(ptrs, wavesize=32, banks=32, multicast=True): | |
# Use: | |
# np.sum(bank_conflicts([thread.x*8 for thread in thread_group(8,8)])) | |
# np.sum(bank_conflicts([thread.id*2 for thread in thread_group(64)])) | |
# Conflicts per wave by bank number: | |
# bank_conflicts([thread.x*8 for thread in thread_group(8,8)]) |
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
# Recipe on running Unity (or any OpenGL based application) on Amazon Cloud EC2 | |
# Requirement: Instance with GPU (g2 or p2) and Ubuntu14.04 | |
# Tested on g2.2xlarge with Ubuntu14.04. | |
# Summary: install NVIDIA driver, configure virtual display, patch configuration, run X server and your application | |
# Also see: https://askubuntu.com/questions/429596/how-to-choose-the-vga-when-setting-up-the-x-server/534622#534622 | |
# prerequisites | |
sudo apt-get update | |
sudo apt-get install -y gcc make linux-generic |
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
# Recipe on running Unity (or any OpenGL based application) offscreen on your local Linux machine. | |
# Requirement: X server, NVIDIA drivers installed and working correctly. | |
# Tested on Ubuntu14.04. | |
# Summary: install XDummy and VirtualGL, configure virtual framebuffer, run your application via VirtualGL | |
# install XDummy | |
sudo apt-get update | |
sudo apt-get install xorg-video-abi-15 xserver-xorg-video-dummy |
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
# Recipe on running Unity (or any OpenGL based application) on Linux machine without monitor. | |
# Requirement: NVIDIA drivers installed and working correctly. | |
# Tested on Ubuntu14.04. | |
# Summary: configure virtual display, run X server and launch your application on the same display as X. | |
# install X server | |
sudo apt-get install xserver-xorg | |
# configure virtual display device for X server |
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
# output -- per layer feature-map of the image we optimize | |
# style -- per layer feature-map of the style image we want to copy | |
# histogram_matching() -- see reference numpy implementation http://stackoverflow.com/a/33047048/7873678 | |
output_remapped = histogram_matching(output, style, nbins=1024) # non-differentiable | |
sum((output_image - output_remapped)**2) # gradients assume that output_remapped ~~ const |
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
# Recipe on compiling and running OpenSWR on AWS Instance (Ubuntu 14.04) | |
# Questions regarding this recipe: @__rej__ | |
# http://openswr.org | |
# prerequisites | |
sudo apt-get update | |
sudo apt-get install git | |
sudo apt-get install build-essential |