Skip to content

Instantly share code, notes, and snippets.

@mnaser
mnaser / OpenStack_consumer_GPU_passthrough.md
Created November 21, 2017 03:25 — forked from claudiok/OpenStack_consumer_GPU_passthrough.md
Consumer-grade GPU passthrough in an OpenStack system (NVIDIA GPUs)

Consumer-grade GPUs in an OpenStack system (NVIDIA GPUs)

Assumptions

This assumes you have GTX980 cards in your system (PCI id 10de:13c0 & 10de:0fbb per card). Just add more IDs for other cards in order to make this more generic. This also assumes nova uses qemu-kvm as the virtualization hypervisor (qemu-system-x86_64). This seems to be the default on OpenStack Newton when installed using openstack-ansible.

We assume OpenStack Newton is pre-installed and that we are working on a Nova compute node. This has been tested on an Ubuntu 16.04 system where I installed OpenStack AIO version 14.0.0 (different from the git tag used in the instructions!): http://docs.openstack.org/developer/openstack-ansible/developer-docs/quickstart-aio.html

Prepare the system for GPU passthrough (set up IOMMU/vfio/...)

Note: This is heavily based on information from https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Enabling_IOMMU adapted for Ubuntu 16.04

@mnaser
mnaser / my_model.rb
Created July 1, 2011 17:12 — forked from denysonique/my_model.rb
Is there a cleaner/simpler way of doing this?
class MyModel < ActiveRecord::Base
after_initialize :setup_defaults
attr_accessor :foo_bar
def setup_defaults
foo_bar ||= "my default value"
end
end