gpu on openstack
play

GPU on OpenStack Masafumi Ohta @masafumiohta Who am I > - PowerPoint PPT Presentation

GPU on OpenStack Masafumi Ohta @masafumiohta Who am I > Working for System Integrator as Pre-Sales Engineer. Working on some OpenStack PoC projects. Proposing OpenStack system to a manufacturer Investigating OpenStack issues reading some


  1. GPU on OpenStack Masafumi Ohta @masafumiohta

  2. Who am I > Working for System Integrator as Pre-Sales Engineer. Working on some OpenStack PoC projects. Proposing OpenStack system to a manufacturer Investigating OpenStack issues reading some codes on OpenStack (working very hard..) For more https://jp.linkedin.com/in/ohtamasafumi

  3. Introduction Now ‘Specific use on OpenStack’ is needed.. Hadoop(Sahara),HPC Almost is not filed therefore we have to investigate with search listings. Say ‘document lost’ in openstack.org.. Need to gather those to docs.openstack.org

  4. What is ‘GPU on OpenStack’

  5. How about ‘GPU’ trends. Using GPU for using many cores. It is better for some calculations to use many MPU cores though each MPU is small and low-speed. Low electric power consumption with GPU is great for HPC end users. Compact systems. is very good for us Japanese HPC systems…

  6. How ‘GPU on OpenStack’? It can be used on ‘PCI passthrough’ or GPGPU docker Perhaps so is AWS. ‘PCI passthrough’ depends on KVM VSphere only can split GPU core to each VM. GPGPU Docker is ‘share GPU with containers but not split. Windows cannot work as ‘docker vm’ Can we split with GPU like vSphere to each VM on KVM? NO, we can only add with GPU unit on VM

  7. What is GPU OpenStack for Instant HPC use Try some calculates and then destroy vm. Orchestrate some vms to try HPC grid computings. Use it like AWS EC2 with GPU Would like to use it internal use - especially manufacturer can’t have some systems on EC2

  8. Setup:GPU on OpenStack

  9. PCI Passthrough(1) PCI devices directly connect to VM via Linux hosts Needs to detach the devices from physical host Depends on KVM, not depends on OpenStack One devices to one VM GPU itself cannot share and split the cores each VMs. it is the limitation in KVM, not OpenStack

  10. PCI Passthrough(2) Redhat officially support passthrough but they dare not to recommend to use that. Ubuntu seems not to document… gather the information with ‘search-listings’

  11. ControllerNode VM Linux/Win OS Linux OS App Nova API GPU Driver Nova Scheduler AMQP ComputeNode Nova Compute Linux OS for KVM hypervisor VMM/KVM IOMMU/Vt-d K PCI Express x16 GPU Card GPU Card Figure1:How GPU passthrough works on OpenStack

  12. Check GPU on KVM host Check GPU first on KVM host with lspci -nn | grep -i nvidia lspci -nn | grep -i nvidia 88:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:11b4] (rev a1) 88:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1) All of GPU units should be passthroughed. Not only GPU itself but also HDMI ports should be done Or it doesn’t work on VM.. (not completely passthroughed..)

  13. GPU output ports GPU has some HDMI ports,which has some audio devices.should be passthroughed as well

  14. IOMMU setup IOMMU(Input/Output Memory Management Unit) is needed by virtual system to use physical devices. Of course intel vt-d must be on (by default in EFI/BIOS) Need to set to grab on /etc/default/grab GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1”

  15. pci-stub pci-stub makes physical pci-devices unused on Linux host. It is not used by default so use ‘/etc/module’ to use it and related components (vfio,kvm) pci_stub vfio vfio_iommu_type1 vfio_pci kvm kvm_intel

  16. VFIO(1) Those passthroughed should be added on VFIO(Virtual Function IO) removing from physical devices. Prohibit to recognized those devices from ramfs /etc/initramfs-tools/modules to initramfs (ubuntu) echo ‘pci_stub ids=10de:11b4,10de:0e0a’ >> /etc/initramfs-tools/modules sudo update-initramfs -u && sudo reboot

  17. VFIO(2) Prohibit to recognized those devices while booting /etc/modprobe.d/blacklist.conf to add below: blacklist nvidia blacklist nvidia-uvm Note compatible drivers should be blacklisted.. blacklist nouveau

  18. Unbind from Physical should check pci-stub to ‘unbind from physical host to bind to VM’:entry passthroughed drivers to new_id to use VM and unbind related identifiers from physical host and bind them to vm. echo 11de 11b4 > /sys/bus/pci/drivers/pci-stub/new_id echo 11de 0e0a > /sys/bus/pci/drivers/pci-stub/new_id echo 0000:88:00.0 > /sys/bus/pci/devices/0000:88:00.0/driver/unbind echo 0000:88:00.1 > /sys/bus/pci/devices/0000:88:00.1/driver/unbind echo 0000:88:00.0 > /sys/bus/pci/drivers/pci-stub/bind echo 0000:88:00.1 > /sys/bus/pci/drivers/pci-stub/bind Check claimed while booting to remove from physical machine. pci-stub 0000:88:00.1: claimed by stub

  19. UEFI/BIOS IOMMU Vt-d GRUB IOMMU /etc/default/grub BLACK ramfs /etc/initramfs-tools/modules LIST modules IOMMU /etc/modules modprobe BLACK /etc/modprobe.d/blacklist.conf LIST BLACK pci-stab LIST /sys/bus/pci/drivers/pci-stub/ /sys/bus/pci/devices/$(Identifier)/driver/unbind Figure2:GPU blacklist process while booting (in Ubuntu Case)

  20. echo 0000:88:00.0 > /sys/bus/pci/devices/0000:88:00.0/driver/unbind echo 0000:88:00.1 > /sys/bus/pci/devices/0000:88:00.1/driver/unbind Physical devices GPU Units (all the devices) ‘Unbind GPU from physical device and bind to virtual device’ pci-stub (use it on virtual) echo 11de 11b4 > /sys/bus/pci/drivers/pci-stub/new_id echo 11de 0e0a > /sys/bus/pci/drivers/pci-stub/new_id echo 0000:88:00.0 > /sys/bus/pci/drivers/pci-stub/bind echo 0000:88:00.1 > /sys/bus/pci/drivers/pci-stub/bind

  21. Add more GPUs(1) check the result of lspci - there should be two device IDs in the result.(that depends on your system..) lspci -nn | grep -i nvidia 88:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:11b4] (rev a1) 88:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1) 84:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:11b4] (rev a1) 84:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)

  22. Add more GPUs(2) unbind more devices to passthrough with pci-stab. echo 0000:84:00.0 > /sys/bus/pci/devices/0000:84:00.0/driver/unbind echo 0000:84:00.1 > /sys/bus/pci/devices/0000:84:00.1/driver/unbind echo 0000:84:00.0 > /sys/bus/pci/drivers/pci-stub/bind echo 0000:84:00.1 > /sys/bus/pci/drivers/pci-stub/bind Need to same GPU’s to use some CUDA apps.they asks it need the same. /nbody -benchmark -numdevices=2 -num bodies=65536

  23. Add more GPUs(3) Here is the result if succeed GPUs working. ubuntu@guestos$ lspci -nn | grep -i nvidia 00:07.0 VGA compatible controller [0300]: NVIDIA Corporation GK104GL [Quadro K4200] [10de:11b4] (rev a1) 00:08.0 VGA compatible controller [0300]: NVIDIA Corporation GK104GL [Quadro K4200] [10de:11b4] (rev a1)

  24. Nova to use passthrough(1) In ComputeNodes whitelist alias should be used for pci passthrough and vm-with-gpu-deployment setting to them to /etc/nova/nova.conf to add pci_passthrough_whitelist pci_passthrough_whitelist={"name":"K4200","vendor_id":"10de","product_id": "11b4"}

  25. Nova to use passthrough(2) In ControllerNodes nova alias should be used for pci passthrough setting to them to /etc/nova/nova.conf to add pci_aliases pci_alias={“name”:”K4200”,"vendor_id":"10de","product_id":"11b4"}

  26. Nova to use passthrough(3) Also in ControllerNodes we should add the pci passthrough filter to nova.conf setting them to /etc/nova/nova.conf following the underline. scheduler_available_filters=nova.scheduler.filters.all_filters scheduler_available_filters=nova.scheduler.filters.pci_passthrough_filter.PciPass throughFilter scheduler_default_filters=DifferentHostFilter,RetryFilter,AvailabilityZoneFilter,Ra mFilter,CoreFilter,DiskFilter,ComputeFilter,ComputeCapabilitiesFilter,ImageProp ertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,AggregateInst anceExtraSpecsFilter,PciPassthroughFilter

  27. nova alias set flavor-key to use GPU instance.add your flavor to pci_passthrough:alias:pci_alias name and amount of gpu you would like to use. nova flavor-key $flavor_name set “pci_passthrough:alias”=“K4200:$amount_of_gpu”

  28. Known issues..

  29. Cloud image issue Images are very small for using GPU thus we need to be resized those cloud images with qemu-img CUDA driver needs perl-packages(dev packages) when installing it. Even though it is .deb or .rpm packages.those package is not binary files,they build the binary from CUDA source codes to run ‘make’ while installing on the system. Nvidia says it will be fixed in CUDA future release.add spec file to those related perl (dev) packages. It will be fixed on CUDA 7.6 or later..

  30. Windows as VDI CUDA on Windows is so faster if you succeed installation but it is often jumpy a bit. it might be occurred by disk speeds on vm.. you might better use ephemeral or something faster (SSD,NVMe or..etc) VM works with context switch thus heavy workloads by CUDA or something might cause jumpy a bit. I haven’t tried yet.I should investigate why it happens. Should have more time to investigate

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend