Giter Club home page Giter Club logo

bootc-pytorch's Introduction

Bootc Image with PyTorch and GPU support

Resources

Prerequisites

  • RHSM subscription - org ID and activation key
  • A non-root user with sudo permissions
  • Optional for running a VM:
    • Install KVM for running a VM
      $ sudo dnf install -y qemu-kvm libvirt virt-install virt-viewer
      $ sudo systemctl enable libvirtd --now
    • Enable PCI pass-through to allow attaching a GPU to a VM - add intel_iommu=on to the host's boot arguments.
    • Update KVM/libvirt permission.

Attaching a host PCI device to a VM

Attaching a PIC device to a running VM can be done either via the VM manager GUI (Add Hardware > PCI Host Device), or using the CLI:

  1. Create an XML file, e.g. pci-device.xml:

    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    ​  <source>
    ​    <address domain='0x<domain>'bus='0x<bus>'slot='0x<slot>'function='0x<function>'/>
    ​  </source>
    ​</hostdev>
    
  2. Attach the device to the VM:

    $ sudo virsh attach-device <domain> pci-device.xml

Note: A host PCI device can be attached when creating a VM, but I never tried that:

Verifying

One of the ways to verify that the GPU is being used, after booting into a bootable image:

$ curl -O https://raw.githubusercontent.com/waggle-sensor/gpu-stress-test/main/stress.py
$ python stress.py

and observe nvidia-smi.

Triggering utilization of multiple GPUs (e.g. 0 through 2):

$ curl -O https://raw.githubusercontent.com/waggle-sensor/gpu-stress-test/main/stress.py
$ for i in $(seq 0 2); do (CUDA_VISIBLE_DEVICES=$i python stress.py &) ; done

bootc-pytorch's People

Contributors

empovit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.