마구잡

오픈스택 GPU PCI Passtrough 설정하기 본문

오픈스택

오픈스택 GPU PCI Passtrough 설정하기

MAGUJOB 2023. 12. 1. 16:48
728x90

개요

Openstack으로 생성한 쿠버네티스 클러스터에 GPU를 사용하고싶어졌다.

그리하여 하나의 인스턴스에 PCI Passtrough통한 GPU 할당을 해보자.

 

GPU 장치의 PCI 번호가 정상적으로 출력된다는 전제하에 해당 절차를 진행한다.

방법

root@osp:~# sudo lspci -nn | grep NVIDIA

ca:00.0 3D controller [0302]: NVIDIA Corporation GA100 [A100 PCIe 80GB] [10de:20b5] (rev a1)

 

위 장치 번호 10de:20b5를 기억하자

 

nova.conf 설정

( nova.conf의 설정이 각 컴포넌트별로 나눠진경우 filter 설정은 novr-scheduler.conf,  PCI 설정은 nova-api.conf에 설정)

[filter_scheduler]
enabled_filters =  PciPassthroughFilter
available_filters = nova.scheduler.filters.all_filters

[pci]
alias = { "vendor_id":"10de", "product_id":"20b5", "device_type":"type-PF", "name":"a1", "numa_policy":"preferred" }

 

nova-compute.conf 설정

[DEFAULT]
compute_driver=libvirt.LibvirtDriver
[libvirt]
virt_type=kvm
[pci]
passthrough_whitelist = { "vendor_id": "10de", "product_id": "20b5" }
alias = { "vendor_id":"10de", "product_id":"20b5", "device_type":"type-PF", "name":"a1" }

 

컴포넌트 재시작 

root@osp:~# systemctl restart nova-scheduler.service nova-api.service nova-compute.service

 

GPU 플레이버 생성

openstack flavor create --public --ram 16384 --disk 100 --vcpus 8 m1.large.gpu
openstack flavor set m1.large.gpu --property pci_passthrough:alias='a1:1'

 

인스턴스 생성

root@osp:~# openstack server create gpu-node --image=ubuntu2204 --flavor=m1.large.gpu --network=provider

 

728x90