KR102001641B1 - Method and apparatus for managing gpu resource in virtualization environment - Google Patents

Method and apparatus for managing gpu resource in virtualization environment Download PDF

Info

Publication number
KR102001641B1
KR102001641B1 KR1020170175585A KR20170175585A KR102001641B1 KR 102001641 B1 KR102001641 B1 KR 102001641B1 KR 1020170175585 A KR1020170175585 A KR 1020170175585A KR 20170175585 A KR20170175585 A KR 20170175585A KR 102001641 B1 KR102001641 B1 KR 102001641B1
Authority
KR
South Korea
Prior art keywords
gpu
guest
graphics processing
host
request
Prior art date
Application number
KR1020170175585A
Other languages
Korean (ko)
Other versions
KR20190074165A (en
Inventor
이성근
Original Assignee
주식회사 티맥스클라우드
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 티맥스클라우드 filed Critical 주식회사 티맥스클라우드
Priority to KR1020170175585A priority Critical patent/KR102001641B1/en
Publication of KR20190074165A publication Critical patent/KR20190074165A/en
Application granted granted Critical
Publication of KR102001641B1 publication Critical patent/KR102001641B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Abstract

본 발명에 의한 가상화 환경에서의 GPU(Graphics Processing Unit) 자원 관리 방법은 호스트 OS(Operating System)가 복수의 게스트 OS 중 적어도 하나의 게스트 OS로부터 그래픽 처리 명령 요청을 수신하는 단계, 상기 호스트 OS가 상기 그래픽 처리 명령 요청을 기반으로 상기 게스트 OS에게 GPU 자원을 할당할지 여부를 판단하는 단계, 및 상기 판단 결과에 따라 상기 호스트 OS가 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하는 단계를 포함한다. A GPU (Graphics Processing Unit) resource management method in a virtualization environment according to the present invention includes the steps of a host OS receiving a graphic processing command request from at least one guest OS of a plurality of guest OSs, Determining whether to allocate GPU resources to the guest OS based on a graphics processing instruction request, and delivering the graphics processing command request to the GPU according to the determination result.

Description

가상화 환경에서의 GPU 자원 관리 방법 및 장치{METHOD AND APPARATUS FOR MANAGING GPU RESOURCE IN VIRTUALIZATION ENVIRONMENT}[0001] METHOD AND APPARATUS FOR MANAGING GPU RESOURCE IN VIRTUALIZATION ENVIRONMENT [0002]

본 발명은 가상화 환경에서의 GPU 자원 관리 방법 및 장치에 관한 것이다. The present invention relates to a method and apparatus for managing GPU resources in a virtualized environment.

GPU(Graphics Processing Unit)는 분자 시뮬레이션, 금융 공학, 클라우드 게이밍, 2D/3D 그래픽 연산 등의 HPC(high-performance computing) 분야 전반에서 사용되는 중요한 장치이다. 특히 클라우드 환경에서 GPU를 탑재한 컴퓨트 노드(compute node)는 사용자에게 운용 비용을 절감하면서도 높은 에너지와 자원 효율을 제공한다. 높은 효율을 제공하면서도 저렴한 가격으로 GPU를 운용하기 위해서는 가상화 기술이 필요하며, 이러한 가상화를 이용한 GPU 운용을 통해 높은 사용률을 얻을 수 있다. 따라서, 현재 대부분의 공공 클라우드(public cloud)에서 사용되고 있는 GPU 가상화 방식보다 효율적이고 유연하게 GPU 자원 관리를 할 수 있는 가상화 방법을 제공하고, 이를 통해 클라우드 서비스 제공자 및 사용자 모두에게 자원 효율성과 비용 절감 효과를 줄 수 있는 방안을 제공하고자 한다. The Graphics Processing Unit (GPU) is an important device used in all areas of high-performance computing (HPC) such as molecular simulation, financial engineering, cloud gaming, and 2D / 3D graphics operations. In particular, a compute node with a GPU in a cloud environment provides users with high energy and resource efficiency while reducing operating costs. Virtualization technology is required to operate the GPU at a low cost while providing high efficiency, and high utilization can be achieved through GPU operation using this virtualization. Therefore, it provides a virtualization method that can more efficiently and flexibly manage GPU resources than the GPU virtualization method currently used in most public clouds, thereby providing resource efficiency and cost savings to both cloud service providers and users And the like.

본 발명은 특정 하드웨어의 종속없이 GPU를 다수의 가상 머신에 효율적으로 분배하는 가상화 환경에서의 GPU 자원 관리 방법 및 장치를 제공한다.The present invention provides a method and apparatus for managing GPU resources in a virtualized environment that efficiently distributes a GPU to a plurality of virtual machines without depending on specific hardware.

본 발명의 일 실시예에 따른 가상화 환경에서의 GPU(Graphics Processing Unit) 자원 관리 방법은, 호스트 OS(Operating System)가 복수의 게스트 OS 중 적어도 하나의 게스트 OS로부터 그래픽 처리 명령 요청을 수신하는 단계, 상기 호스트 OS가 상기 그래픽 처리 명령 요청을 기반으로 상기 게스트 OS에게 GPU 자원을 할당할지 여부를 판단하는 단계, 및 상기 판단 결과에 따라 상기 호스트 OS가 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하는 단계를 포함한다. A GPU (Graphics Processing Unit) resource management method in a virtualization environment according to an embodiment of the present invention includes a step of a host OS receiving a graphic processing command request from at least one guest OS of a plurality of guest OSs, The host OS determining whether to allocate GPU resources to the guest OS based on the graphics processing command request, and delivering the graphics processing command request to the GPU according to the determination result .

일 실시예에 있어서, 상기 GPU 자원을 할당할지 여부를 판단하는 단계는, 상기 그래픽 처리 명령 요청이 병렬 연산 처리를 수행하는 경우, 상기 호스트 OS가 상기 게스트 OS의 시간 할당량(quota)이 기 설정된 조건을 만족하는지 여부를 판단하는 단계를 포함할 수 있다. In one embodiment, the step of determining whether or not to allocate the GPU resource may include the steps of: when the graphic processing command request performs parallel computing processing, if the host OS determines that the time quota of the guest OS is greater than a predetermined condition And determining whether or not it satisfies a predetermined condition.

일 실시예에 있어서, 상기 GPU 자원을 할당할지 여부를 판단하는 단계는, 상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는 경우, 상기 게스트 OS에 상기 병렬 연산 처리를 위한 GPU의 스트림 프로세서를 할당하는 것으로 판단하며, 상기 게스트 OS에 상기 GPU의 스트림 프로세서를 할당한 결과에 따라, 상기 GPU 스트림 프로세서의 할당 시간을 반영하여 상기 게스트 OS의 시간 할당량을 재계산하고, 상기 재계산된 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는지 판단하는 단계를 더 포함할 수 있다. In one embodiment, the step of determining whether or not to allocate the GPU resource includes: allocating a stream processor of the GPU for the parallel operation processing to the guest OS when the time allocation amount of the guest OS satisfies a preset condition Calculates a time allocation amount of the guest OS by reflecting the allocation time of the GPU stream processor according to a result of allocating the stream processor of the GPU to the guest OS, And determining whether the quota satisfies the predetermined condition.

일 실시예에 있어서, 상기 GPU 자원을 할당할지 여부를 판단하는 단계는, 상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하지 않는 경우, 상기 게스트 OS의 GPU 자원 배분율 및 상기 GPU 자원에 대한 단위 시간당 시간 할당량의 재생률을 기반으로 상기 게스트 OS의 시간 할당량이 상기 기 설정된 조건을 만족할 때까지 상기 그래픽 처리 명령 요청을 저장하는 단계를 포함할 수 있다.In one embodiment, the step of determining whether or not to allocate the GPU resource may include determining a GPU resource allocation ratio of the guest OS and a unit time per unit time of the GPU resource when the time allocation amount of the guest OS does not satisfy the pre- And storing the graphics processing instruction request until the time allocation amount of the guest OS satisfies the preset condition based on the refresh rate of the time allocation amount.

일 실시예에 있어서, 상기 GPU 자원을 할당할지 여부를 판단하는 단계는, 상기 그래픽 처리 명령 요청이 GPU의 메모리 접근을 시도하는 경우, 상기 호스트 OS의 그래픽 라이브러리가 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는지 여부를 판단하는 단계를 포함할 수 있다.In one embodiment, the step of determining whether to allocate the GPU resource comprises: if the graphics processing instruction request attempts to access a memory of the GPU, the graphics library of the host OS requests the GPU Determining whether the memory usage of the guest OS exceeds the memory amount of the GPU allocated to the guest OS.

일 실시예에 있어서, 상기 GPU 자원을 할당할지 여부를 판단하는 단계는, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하지 않는 경우, 상기 호스트 OS의 그래픽 라이브러리가 상기 그래픽 처리 명령 요청을 상기 호스트 OS의 디바이스 드라이버로 전달하는 단계를 포함할 수 있다.In one embodiment, the step of determining whether or not to allocate the GPU resource may include determining whether to allocate the GPU resource if the memory usage of the GPU according to the graphics processing instruction request does not exceed the memory amount of the GPU allocated to the guest OS, The graphic library of the OS may transmit the graphic processing command request to the device driver of the host OS.

일 실시예에 있어서, 상기 GPU 자원을 할당할지 여부를 판단하는 단계는, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는 경우, 상기 호스트 OS의 그래픽 라이브러리가 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하지 못하도록 제어하는 단계를 포함할 수 있다.In one embodiment, the step of determining whether or not to allocate the GPU resource may include the steps of: when the memory usage of the GPU according to the graphic processing command request exceeds the memory amount of the GPU allocated to the guest OS, To prevent the graphics library of the GPU from forwarding the graphics processing instruction request to the GPU.

일 실시예에 있어서, 상기 가상화 환경에서의 GPU 자원 관리 방법은 상기 게스트 OS의 가상 GPU 드라이버가 애플리케이션으로부터 상기 그래픽 처리 명령 요청을 수신하는 단계, 상기 게스트 OS의 가상 GPU 드라이버가 상기 게스트 OS에 할당된 GPU의 메모리량을 확인하여, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량과 비교하는 단계, 및 상기 비교 결과에 따라, 상기 게스트 OS의 가상 GPU 드라이버가 상기 그래픽 처리 명령 요청을 상기 호스트 OS로 전달할지 여부를 결정하는 단계를 더 포함할 수 있다. In one embodiment, a method for managing GPU resources in a virtualized environment includes the steps of: receiving a request for a graphics processing instruction from an application, the virtual GPU driver of the guest OS; Comparing a memory amount of the GPU with a memory usage amount of the GPU according to the graphic processing command request; and controlling the virtual GPU driver of the guest OS to transmit the graphic processing command request to the host OS And determining whether to deliver the message.

일 실시예에 있어서, 상기 가상화 환경에서의 GPU 자원 관리 방법은 상기 게스트 OS가 애플리케이션으로부터 생성된 상기 그래픽 처리 명령 요청을 수신하는 단계, 상기 게스트 OS의 그래픽 라이브러리가 상기 수신한 그래픽 처리 명령 요청을 상기 호스트 OS의 GPU API 형식으로 가공하는 단계, 및 상기 게스트 OS의 가상 GPU 드라이버가 상기 가공된 그래픽 처리 명령 요청을 상기 호스트 OS로 전달하는 단계를 더 포함할 수 있다. In one embodiment, a GPU resource management method in the virtualization environment includes: receiving the graphic processing command request generated by an application from the application OS; receiving, by the graphics library of the guest OS, Processing into the GPU API format of the host OS, and the virtual GPU driver of the guest OS transferring the processed graphics processing instruction request to the host OS.

본 발명의 일 실시예에 따른 GPU 가상화 장치는 애플리케이션으로부터 생성된 그래픽 처리 명령 요청을 호스트 OS로 전달하는 게스트 OS, 및 상기 그래픽 처리 명령 요청을 기반으로 상기 게스트 OS에게 GPU 자원을 할당할지 여부를 판단하고, 상기 판단 결과에 따라 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하는 호스트 OS를 포함한다. The GPU virtualization apparatus according to an embodiment of the present invention includes a guest OS for transferring a request for a graphics processing command generated from an application to a host OS, and for determining whether to allocate a GPU resource to the guest OS based on the graphics processing command request And a host OS for transferring the graphic processing command request to the GPU according to the determination result.

일 실시예에 있어서, 상기 호스트 OS는, 상기 그래픽 처리 명령 요청이 병렬 연산 처리를 수행하는 경우, 상기 게스트 OS의 시간 할당량(quota)이 기 설정된 조건을 만족하는지 여부를 판단할 수 있다. In one embodiment, the host OS may determine whether the time quota of the guest OS satisfies a predetermined condition when the graphics processing command request performs parallel computing processing.

일 실시예에 있어서, 상기 호스트 OS는, 상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는 경우, 상기 게스트 OS에 상기 병렬 연산 처리를 수행하는 GPU의 스트림 프로세서를 할당하는 것으로 판단하며, 상기 게스트 OS에 상기 GPU의 스트림 프로세서를 할당한 결과에 따라, 상기 GPU 스트림 프로세서의 할당 시간을 반영하여 상기 게스트 OS의 시간 할당량을 재계산하고, 상기 재계산된 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는지 판단할 수 있다. In one embodiment, the host OS determines that a stream processor of the GPU performing the parallel operation processing is allocated to the guest OS when the time allocation amount of the guest OS satisfies a predetermined condition, Calculating a time allocation amount of the guest OS by reflecting the allocation time of the GPU stream processor according to a result of allocating the stream processor of the GPU to the OS, and if the time allocation amount of the recalculated guest OS satisfies predetermined conditions Can be determined.

일 실시예에 있어서, 상기 호스트 OS는, 상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하지 않는 경우, 상기 게스트 OS의 GPU 자원 배분율 및 상기 GPU 자원에 대한 단위 시간당 시간 할당량의 재생률을 기반으로 상기 게스트 OS의 시간 할당량이 상기 기 설정된 조건을 만족할 때까지 상기 그래픽 처리 명령 요청을 저장하는 버퍼부를 포함할 수 있다. In one embodiment, the host OS determines, based on the GPU resource allocation rate of the guest OS and the playback rate of the time allocation amount per unit time for the GPU resource, when the time allocation amount of the guest OS does not satisfy the pre- And a buffer unit for storing the graphics processing instruction request until the time allocation amount of the guest OS satisfies the predetermined condition.

일 실시예에 있어서, 상기 호스트 OS는, 상기 그래픽 처리 명령 요청이 GPU의 메모리 접근을 시도하는 경우, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는지 여부를 판단하는 그래픽 라이브러리를 포함할 수 있다. In one embodiment, the host OS determines that the memory usage of the GPU in response to the graphics processing instruction request is greater than the memory amount of the GPU allocated to the guest OS when the graphic processing command request tries to access the GPU memory And a graphic library for determining whether the value exceeds the threshold value.

일 실시예에 있어서, 상기 그래픽 라이브러리는, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하지 않는 경우, 상기 그래픽 처리 명령 요청을 상기 호스트 OS의 디바이스 드라이버로 전달할 수 있다. In one embodiment, if the memory usage of the GPU according to the graphics processing instruction request does not exceed the memory amount of the GPU allocated to the guest OS, the graphic library may transmit the graphic processing command request to the host OS Device driver.

일 실시예에 있어서, 상기 그래픽 라이브러리는, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는 경우, 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하지 못하도록 제어할 수 있다. In one embodiment, if the memory usage of the GPU according to the graphics processing instruction request exceeds the memory amount of the GPU allocated to the guest OS, the graphics library does not transfer the graphics processing command request to the GPU Can not be controlled.

일 실시예에 있어서, 상기 게스트 OS는, 애플리케이션으로부터 상기 그래픽 처리 명령 요청을 수신하고, 상기 게스트 OS에 할당된 GPU의 메모리량을 확인하여, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량과 비교하고, 상기 비교 결과에 따라, 상기 그래픽 처리 명령 요청을 상기 호스트 OS로 전달할지 여부를 결정하는 가상 GPU 드라이버를 포함할 수 있다. In one embodiment, the guest OS receives the graphics processing instruction request from an application, verifies the amount of memory of the GPU allocated to the guest OS, and compares it with the memory usage of the GPU in response to the graphics processing instruction request And a virtual GPU driver that determines whether to transmit the graphic processing command request to the host OS according to the comparison result.

일 실시예에 있어서, 상기 게스트 OS는, 애플리케이션으로부터 생성된 상기 그래픽 처리 명령 요청을 수신하고, 상기 수신한 그래픽 처리 명령 요청을 상기 호스트 OS의 GPU API 형식으로 가공하는 그래픽 라이브러리를 포함하며, 상기 가상 GPU 드라이버는, 상기 가공된 그래픽 처리 명령 요청을 상기 호스트 OS로 전달할 수 있다. In one embodiment, the guest OS includes a graphic library that receives the graphics processing instruction request generated from an application and processes the received graphics processing instruction request into a GPU API format of the host OS, The GPU driver may forward the processed graphics processing instruction request to the host OS.

본 발명은, 본 발명의 일 실시예에 의한 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 포함한다. The present invention includes a computer-readable recording medium storing a program for causing a computer to execute a method according to an embodiment of the present invention.

본 발명에 따르면, 클라우드 환경에서 특정 하드웨어 종속없이 GPU를 다수의 가상 머신에 효율적으로 분배할 수 있어서 하드웨어 기능에 의존하는 패스스루 방식이나 SR-IOV보다 유연하고 가격 경쟁력을 향상시킬 수 있다. According to the present invention, a GPU can be efficiently distributed to a plurality of virtual machines without specific hardware dependency in a cloud environment, so that it is more flexible than a pass-through method or SR-IOV depending on hardware functions and can improve price competitiveness.

본 발명에 따르면, 실제 GPU 제조사의 드라이버를 사용하면서 반가상화 기법을 사용하므로, GPU 사용률 및 성능을 높일 수 있다. According to the present invention, since the paravirtualization technique is used while using the driver of the actual GPU maker, the GPU utilization rate and performance can be improved.

본 발명에 따르면, GPU 자원 관리 방법을 제공함으로써 클라우드 환경에서 GPU 자원에 대한 노이지 네이버(noisy neighbor effect, 예기치 않은 트래픽 증가)로 인한 문제 및 DOS 공격 문제를 차단할 수 있다. According to the present invention, it is possible to prevent a problem due to a noisy neighbor effect (GPU resource increase) and a DOS attack problem in a cloud environment by providing a GPU resource management method.

도 1은 하드웨어적 방식으로 GPU 장치를 가상화하는 방법을 설명하기 위한 도면이다.
도 2는 본 발명의 일 실시예에 따른 반가상화 기법을 이용한 GPU 가상화 장치를 나타낸 도면이다.
도 3은 본 발명의 일 실시예에 따른 GPU 자원 관리 방법을 수행하는 GPU 가상화 장치의 구성을 나타낸 도면이다.
도 4는 본 발명의 일 실시예에 따른 반가상화 기법를 이용한 GPU 자원 관리 방법을 나타낸 순서도이다.
1 is a diagram for explaining a method of virtualizing a GPU device in a hardware manner.
FIG. 2 illustrates a GPU virtualization apparatus using a paravirtualization technique according to an exemplary embodiment of the present invention. Referring to FIG.
3 is a block diagram of a GPU virtualization apparatus for performing a GPU resource management method according to an embodiment of the present invention.
4 is a flowchart illustrating a GPU resource management method using a paravirtualization technique according to an embodiment of the present invention.

이하에서 본 발명의 기술적 사상을 명확화하기 위하여 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세하게 설명하도록 한다. 본 발명을 설명함에 있어서, 관련된 공지 기능 또는 구성요소에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략할 것이다. 도면들 중 실질적으로 동일한 기능구성을 갖는 구성요소들에 대하여는 비록 다른 도면상에 표시되더라도 가능한 한 동일한 참조번호들 및 부호들을 부여하였다. 설명의 편의를 위하여 필요한 경우에는 장치와 방법을 함께 서술하도록 한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings in order to clarify the technical idea of the present invention. In the following description of the present invention, a detailed description of known functions and configurations incorporated herein will be omitted when it may make the subject matter of the present invention rather unclear. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram of a computer system according to an embodiment of the present invention; Fig. For convenience of explanation, the apparatus and method are described together when necessary.

가상화 기술은 클라우드를 가능하게 하는 핵심 기술 중 하나이다. 가상화 기술은 CPU, 메모리, 주변 기기들을 추상화하여 가상 머신에게 보여주는 하드웨어 기반 가상화 방법과, 운영체제(OS; Operating System) 커널은 공유하되 컨테이너라고 불리는 서로 격리된 공간을 생성하여 각각의 공간에서 제한된 CPU, 메모리 등의 자원을 할당하여 응용 프로그램을 실행하는 OS 기반 가상화 방법 등으로 나누어진다. Virtualization technology is one of the core technologies that enable the cloud. Virtualization technology is a hardware-based virtualization method that abstracts CPUs, memories, and peripherals to virtual machines, and creates an isolated space called a container that shares an operating system (OS) kernel, And OS-based virtualization methods that allocate resources such as memory to run application programs.

하드웨어 기반 가상화의 경우 일반적으로 하드웨어 자원을 가상화하여 논리적인 하드웨어를 생성하고, 각각의 논리적인 하드웨어 안에 별도의 OS를 설치하여 원하는 소프트웨어를 실행한다. 이때, 논리적인 하드웨어 안에 설치된 OS를 게스트 OS라고 하며, 논리적인 하드웨어를 생성하고 게스트 OS를 실행하는 별도의 소프트웨어가 필요한데 이를 하이퍼바이저(hypervisor) 혹은 가상 머신 모니터라고 한다. 또한 하이퍼바이저를 실행시키기 위해서 OS가 필요하며, 이를 호스트 OS라고 한다. In hardware-based virtualization, hardware resources are generally virtualized to create logical hardware, and a separate OS is installed in each logical hardware to execute desired software. At this time, the OS installed in the logical hardware is referred to as a guest OS, and additional software for creating the logical hardware and running the guest OS is required, which is called a hypervisor or a virtual machine monitor. Also, the OS is required to run the hypervisor, which is called the host OS.

일반적으로 GPU와 같은 I/O 장치를 가상화 하기 위해서 하드웨어적 기법을 사용한다. 하드웨어적 기법은 패스스루(passthrough) 방식 및 SR-IOV(Single Root Input/Output Virtualization) 방식을 포함한다.In general, hardware techniques are used to virtualize I / O devices such as GPUs. Hardware techniques include a passthrough scheme and a single root input / output virtualization (SR-IOV) scheme.

도 1은 하드웨어적 방식으로 GPU 장치를 가상화하는 방법을 설명하기 위한 도면이다. 도 1의 (a)는 패스스루 방식을 나타낸 것이고, 도 1의 (b)는 SR-IOV 방식을 나타낸 것이다. 1 is a diagram for explaining a method of virtualizing a GPU device in a hardware manner. FIG. 1 (a) shows a pass-through system, and FIG. 1 (b) shows an SR-IOV system.

도 1의 (a)를 참조하면, 패스스루 방식은 하나의 하드웨어(예: GPU)(140)를 하나의 가상 머신(110 또는 111)에게 할당하는 방식이다. 이때, 하이퍼바이저(120)는 CPU의 가상 I/O 보조 기능을 이용하여 가상 머신(110 또는 111)이 인식하는 기기(예: GPU)의 가상 주소와 호스트 OS(130)에서 인식하는 기기(예: GPU)의 실제 주소를 연동시켜 놓고, 이후에는 별도의 개입을 하지 않는다. 게스트 OS(110 또는 111)가 GPU(140)에 접근하는 경우, CPU의 가상 I/O 기능에 의하여 게스트 OS(110 또는 111)에서 인식된 GPU의 가상 주소를 이와 연동된 호스트 OS(130)의 실제 물리적 주소로 변환하여 게스트 OS(110 또는 111)가 GPU(140)를 사용할 수 있도록 한다. Referring to FIG. 1 (a), a pass-through method is a method of allocating one hardware (e.g., GPU) 140 to one virtual machine 110 or 111. At this time, the hypervisor 120 uses the virtual I / O auxiliary function of the CPU to compare the virtual address of a device (e.g., a GPU) recognized by the virtual machine 110 or 111 and the virtual address of a device recognized by the host OS 130 : GPU), and do not intervene later. When the guest OS 110 or 111 accesses the GPU 140, the virtual address of the GPU recognized by the guest OS 110 or 111 by the virtual I / O function of the CPU is transferred to the host OS 130 And converts it into an actual physical address so that the guest OS 110 or 111 can use the GPU 140. [

이와 같은 패스스루 방식을 이용하는 하드웨어적 기법은 가상 머신이 실제 하드웨어에 바로 접근하기 때문에, 성능이 높으며 하드웨어 제조사에서 제공하는 최적화된 드라이버를 이용하여 실행된다는 장점이 있다. 그러나 하드웨어를 하나의 가상 머신에게 할당해버리기 때문에 유연성이 매우 떨어진다. 예를 들어, GPU를 사용하고 있는 가상 머신이 GPU 성능의 10% 정도를 사용하는 경우, 나머지 90%의 GPU 성능은 낭비할 수 밖에 없게 된다. 또한 하나의 물리 머신 내에 여러 개의 가상 머신이 존재하는 경우, 가상 머신의 개수만큼 GPU가 준비되어야 하므로 자원 효율성이 떨어진다. The hardware technique using the pass-through method is advantageous in that the virtual machine directly accesses the actual hardware, so that the performance is high and it is executed using the optimized driver provided by the hardware manufacturer. However, it is very inflexible because it allocates hardware to one virtual machine. For example, if a virtual machine using a GPU uses about 10% of the GPU's performance, the remaining 90% of the GPU's performance will be wasted. Also, when there are several virtual machines in one physical machine, resource efficiency is degraded since the number of virtual machines must be prepared by the number of GPUs.

도 1의 (b)를 참조하면, SR-IOV 방식은 PCI 표준의 일부로서 하나의 하드웨어(예: GPU)(240)를 여러 개의 가상 하드웨어(241, 242)로 나누어 가상 머신(210, 211)에게 할당하는 방식이다. 즉, SR-IOV 표준에 따라 GPU 자체가 여러 개의 논리적 GPU로 분리되는 것이므로, 각각의 논리적 GPU를 각각의 가상 머신에게 할당하고, 각각의 가상 머신은 패스스루 기법처럼 논리적 GPU를 사용할 수 있다. Referring to FIG. 1B, the SR-IOV method divides one piece of hardware (e.g., GPU) 240 into a plurality of pieces of virtual hardware 241 and 242 as part of a PCI standard, . That is, according to the SR-IOV standard, since the GPU itself is divided into a plurality of logical GPUs, each logical GPU can be assigned to each virtual machine, and each virtual machine can use a logical GPU like a pass-through technique.

따라서, SR-IOV 방식은 패스스루의 성능적 장점을 가지면서도 하나의 하드웨어를 여러 가상 머신이 나누어 쓸 수 있는 장점을 가진다. 또한 하드웨어적으로 가상 머신 간의 공유를 지원하므로, 하나의 가상 머신이 하드웨어를 독점하는 패스스루 방식에 비해 유연성이 높다. 그러나, SR-IOV 방식을 사용하는 기기는 가격이 높아서 클라우드 환경에서 서비스를 제공하는데 드는 비용을 낮추기 어려울 수 있다. 또한, SR-IOV 스펙을 지원하는 기기의 종류가 다양하지 않기 때문에 유스케이스(use case)에 맞는 기기를 찾기 어려울 수 있다. Therefore, the SR-IOV scheme has the merit of allowing multiple virtual machines to share one hardware while having the performance advantages of pass-through. In addition, since it supports sharing between virtual machines in hardware, it is more flexible than a pass-through method in which one virtual machine monopolizes hardware. However, devices using the SR-IOV method are expensive and it may be difficult to lower the cost of providing services in a cloud environment. In addition, since the types of devices supporting the SR-IOV specification do not vary, it may be difficult to find a device that fits the use case.

상술한 하드웨어적 기법의 가상화 방법을 사용할 경우의 문제점을 해결하기 위해서 소프트웨어적 기법을 사용하여 GPU 장치를 가상화할 수 있다. 소프트웨어적 기법은 전가상화(full virtualization) 방식 및 반가상화(paravirtualization) 방식을 포함한다. In order to solve the problem of using the hardware virtualization method described above, a GPU device can be virtualized using a software technique. Software techniques include full virtualization and paravirtualization.

전가상화 방식은 GPU를 사용해야 하는 경우에 실제로는 GPU를 사용하지 않고, CPU 자원을 사용하여 GPU 동작을 에뮬레이션하는 방식이다. 게스트 OS가 GPU를 사용하고자 할 경우, 그래픽 명령(graphic command)이 게스트 OS의 그래픽 스택(graphic stack)을 통하여 게스트 OS의 GPU 드라이버까지 도달하고, 이때 GPU 드라이버가 하이퍼바이저에게 GPU 에뮬레이션을 요청한다. 전가상화 방식은 원격 데스크톱 서비스 등과 같이 고성능 GPU를 필요로 하지 않는 애플리케이션을 사용하는 경우에 적합할 수 있다. 그러나, 전가상화 방식에서는 하이퍼바이저가 CPU를 이용하여 GPU의 모든 동작을 수행하도록 하므로, 성능면에서 GPU를 직접 사용하는 것보다 효율이 떨어진다. 따라서 GPU의 제한적인 기능만 사용하는 경우가 아니라면, GPU 성능 문제로 인해 전가상화 방식을 적용하여 사용하는 사용처에 한계가 있다. 또한 근본적으로 연산 처리에 있어서 CPU와 GPU는 서로 다른 개념을 갖고 있기 때문에, CPU를 이용하여 GPU의 기능을 구현하기에는 개발상의 어려움이 있다. The former virtualization method is to emulate GPU operation using CPU resources instead of actually using the GPU when the GPU needs to be used. When the guest OS wants to use the GPU, a graphic command reaches the GPU driver of the guest OS through the graphic stack of the guest OS, at which time the GPU driver requests the GPU emulation. Pre-virtualization may be appropriate for applications that do not require a high-performance GPU, such as Remote Desktop Services. However, in the virtualization method, the hypervisor uses the CPU to perform all operations of the GPU, which is less efficient than using the GPU directly in terms of performance. Therefore, unless you are only using the limited features of the GPU, there are limitations to the use of virtualization because of GPU performance issues. Also, since CPU and GPU have fundamentally different concepts in computation processing, it is difficult to develop GPU functions using a CPU.

반가상화 방식은 게스트 OS가 GPU를 사용하고자 할 경우 OpenGL 등을 사용하여 API 호출을 수행하고, 호스트 OS가 API 호출을 전달받아 GPU 명령을 처리하는 API 포워딩(forwarding) 방법을 사용한다. 이러한 API 포워딩 방법은 모든 GPU 명령에 대해 API 호출을 구현해야 하므로 개발 난이도가 높다. 또한 대규모 클러스터에서 모든 API 호출을 네트워크를 통해 다른 머신으로 포워딩해야 하므로, 네트워크 오버헤드가 발생되어 성능 저하를 가져올 수 있다. The paravirtualization method uses an API forwarding method in which a guest OS executes an API call using OpenGL or the like and a host OS receives an API call and processes a GPU command when the guest OS uses the GPU. This API forwarding method has a high degree of development difficultness because it needs to implement an API call for all GPU commands. Also, in large clusters, all API calls must be forwarded over the network to other machines, resulting in network overhead and performance degradation.

한편, GPU 가상화는 GPU 제조사 간의 GPU 설계의 비표준화, OpenGL 등의 그래픽 API 버전의 파편화 등의 문제점을 가지고 있다. 이러한 문제점으로 인해 공공 클라우드 서비스 제공자들은 고성능 GPU 가상화에 있어서 일반적으로 패스스루 방식을 취하고 있다. 이 방식은 GPU 드라이버 제조사가 만든 것을 직접 쓰기 때문에 기술적으로 구현하기 쉽고, 또한 하드웨어적으로 가상 머신과 GPU 장치 간의 통신을 지원하므로 높은 성능을 기대할 수 있다. 하지만 상술한 바와 같이 패스스루 방식은 하나의 가상 머신에서 하나의 GPU를 독점하여 사용하므로, 가상 머신이 GPU 장치의 성능을 전부 사용하지 않는 경우에는 GPU 자원을 낭비하게 되는 구조적 문제점을 가지고 있다. GPU virtualization, on the other hand, has problems such as non-standardization of GPU design among GPU makers and fragmentation of graphics API version such as OpenGL. Because of this problem, public cloud service providers are generally taking the pass-through approach for high-performance GPU virtualization. This method is easy to implement technically because the GPU driver maker writes directly, and also supports high-performance communication between the virtual machine and the GPU device in hardware. However, as described above, since the pass-through method uses a single GPU in a single virtual machine, the GPU resources are wasted if the virtual machine does not use all the capabilities of the GPU.

본 발명에서는 상술한 문제점들을 해결하기 위해 반가상화 기법을 응용하여 하드웨어의 기능에 의존하지 않고 보다 효율적이고 유연하게 GPU 자원 관리를 할 수 있는 방법을 제안하고자 한다. In order to solve the above-described problems, the present invention proposes a method for applying GPU resources more efficiently and flexibly without relying on hardware functions by applying a paravirtualization technique.

도 2는 본 발명의 일 실시예에 따른 반가상화 기법을 이용한 GPU 가상화 장치를 개략적으로 나타낸 도면이다. FIG. 2 is a schematic diagram of a GPU virtualization apparatus using a paravirtualization technique according to an embodiment of the present invention. Referring to FIG.

도 2를 참조하면, 본 발명의 일 실시예에 따른 반가상화 기법을 이용한 GPU 가상화 장치(이하, "GPU 가상화 장치"라 함)(300)는 복수의 게스트 OS(310, 320), 호스트 OS(340), 및 GPU(350)를 포함할 수 있다. Referring to FIG. 2, a GPU virtualization apparatus 300 (hereinafter referred to as a GPU virtualization apparatus) using a paravirtualization technique according to an embodiment of the present invention includes a plurality of guest OSs 310 and 320, a host OS 340, and a GPU 350.

복수의 게스트 OS(310, 320)는 각각 가상 머신 상에서 동작할 수 있으며, 각각 그래픽 스택(311, 321) 및 가상 GPU 드라이버(312, 322)를 포함할 수 있다. 도 2에서는 설명의 편의를 위하여 2개의 게스트 OS를 포함하는 것으로 도시하였으나, 이는 하나의 예시일 뿐이며 본 발명에 따른 GPU 가상화 장치는 2개 이상의 게스트 OS를 포함하여 동작할 수 있다. The plurality of guest OSes 310 and 320 may each be operable on a virtual machine and may include graphics stacks 311 and 321 and virtual GPU drivers 312 and 322, respectively. Although FIG. 2 illustrates two guest OSs for convenience of explanation, the GPU virtualization apparatus according to the present invention may include two or more guest OSes.

호스트 OS(340)는 그래픽 스택(341) 및 하이퍼바이저(330)를 포함할 수 있다. 하이퍼바이저(330)는 복수의 게스트 OS(310, 320)가 하나의 GPU(350)를 논리적으로 사용할 수 있도록 자원관리 및 OS 간의 스케줄링을 하는 논리적인 플랫폼이다. 예를 들어, 하이퍼바이저(330)는 Xen, Citrix의 XenServer, VMware의 ESX Server, L4 마이크로커널, TRANGO, IBM의 POWER 하이퍼바이저(PR/SM), 마이크로소프트의 하이퍼-V, 패러럴 서버, 썬의 로지컬 도메인 하이퍼바이저, VMware Server, VMware Workstation, VMware Fusion, QEMU, 마이크로소프트의 버추얼 PC와 버추얼 서버, Oracle(SUN)의 버추얼박스, SWsoft의 Parallels Workstation과 Parallels Desktop 등을 사용할 수 있다. The host OS 340 may include a graphics stack 341 and a hypervisor 330. The hypervisor 330 is a logical platform that performs resource management and scheduling between OSs so that a plurality of guest OSes 310 and 320 can use one GPU 350 logically. For example, the hypervisor 330 may be a hypervisor, such as Xen, Citrix XenServer, VMware's ESX Server, L4 microkernel, TRANGO, IBM's POWER hypervisor (PR / SM), Microsoft Hyper- You can use Logical Domain Hypervisor, VMware Server, VMware Workstation, VMware Fusion, QEMU, Microsoft's Virtual PC and Virtual Server, Oracle (SUN) VirtualBox, SWsoft's Parallels Workstation and Parallels Desktop.

일 실시예로, 게스트 OS(310, 320)는 하이퍼바이저(330)가 보여주는 가상 GPU 드라이버(312, 322)를 로딩하여 설치할 수 있다. 이후 게스트 OS(310, 320)에서 그래픽 처리가 필요한 경우, 게스트 OS(310, 320)는 그래픽 처리 명령을 생성하여 그래픽 스택(311, 321)으로 전달하고, 전달된 그래픽 처리 명령은 그래픽 스택(311, 321)을 통과하여 가상 GPU 드라이버(312, 322)로 전달된다. 이때, 그래픽 처리 명령은 게스트 OS(310, 320)와 호스트 OS(340) 간의 약속된 형태인 표준화된 GPU API 형식으로 가공될 수 있다. 가상 GPU 드라이버(312, 322)는 가공된 그래픽 처리 명령을 호스트 OS(340)의 그래픽 스택(341)으로 전달할 수 있다. 호스트 OS(340)는 실제 물리적인 GPU(350)에게 그래픽 처리 명령을 요청할 수 있다. 이때, 호스트 OS(340)는 게스트 OS(310, 320)에서 그래픽 처리 명령을 요청한 애플리케이션의 GPU 컨텍스트(context)와 연동하여 그래픽 처리 명령을 처리할 수 있다. 또한 호스트 OS(340)에서는 실제 GPU 제조사에서 제공하는 고성능의 디바이스 드라이버를 사용하여 그래픽 처리 명령을 처리할 수 있다. 다시 말해, 게스트 OS(310, 320)가 어떤 OS를 사용하는지 상관없이, 게스트 OS(310, 320) 측에서는 가상 GPU 드라이버(312, 322)를 통해서 호스트 OS(340)가 원하는 형태로 그래픽 처리 명령을 만들어서 넘겨주면, 호스트 OS(340) 측에서는 고성능의 드라이버를 사용하여 그래픽 처리 명령 요청을 지원해 줄 수 있다. 따라서, 클라우드 환경에서는 사용자의 가상 머신 내에 가상 디바이스 드라이버만 있으면 OS의 종류에 관계없이 GPU 자원을 유연하게 지원해 줄 수 있다. 또한 게스트 OS(310, 320)의 애플리케이션 단위로 GPU 컨텍스트를 관리하기 때문에 하나의 물리적 GPU를 자연스럽게 복수의 게스트 OS(310, 320)에서 공유해서 사용할 수 있다. In one embodiment, the guest OSes 310 and 320 may load and install the virtual GPU drivers 312 and 322 shown by the hypervisor 330. The guest OS 310 and 320 generates a graphic processing command and transfers the graphic processing command to the graphic stacks 311 and 321. The received graphic processing command is transmitted to the graphic stack 311 , 321, and is transmitted to the virtual GPU drivers 312, 322. At this time, the graphics processing command can be processed into the standardized GPU API format, which is a promised form between the guest OS 310, 320 and the host OS 340. The virtual GPU drivers 312 and 322 may communicate the processed graphics processing instructions to the graphics stack 341 of the host OS 340. [ The host OS 340 may request the graphics processing command from the actual physical GPU 350. [ At this time, the host OS 340 can process graphics processing commands in conjunction with the GPU context of the application requesting the graphics processing command in the guest OS 310, 320. [ In addition, the host OS 340 can process graphic processing commands using a high-performance device driver provided by an actual GPU manufacturer. In other words, regardless of which OS the guest OS 310 or 320 uses, the guest OS 310 or 320 uses the virtual GPU driver 312 or 322 to instruct the host OS 340 to execute a graphic processing command The host OS 340 can support a graphic processing command request using a high-performance driver. Therefore, in a cloud environment, a virtual device driver in a user's virtual machine can flexibly support GPU resources regardless of the type of OS. In addition, since the GPU context is managed in units of applications of the guest OSs 310 and 320, one physical GPU can naturally be shared by a plurality of guest OSes 310 and 320 and used.

도 3은 본 발명의 일 실시예에 따른 GPU 자원 관리 방법을 수행하는 GPU 가상화 장치의 구성을 나타낸 도면이다. 3 is a block diagram of a GPU virtualization apparatus for performing a GPU resource management method according to an embodiment of the present invention.

도 3을 참조하면, GPU 가상화 장치(400)는 게스트 OS(410), 호스트 OS(420), 및 GPU(430)를 포함할 수 있다. 도 3의 GPU 가상화 장치(400)는 설명의 편의를 위하여 하나의 게스트 OS(410)를 포함하는 것으로 도시하였으나, 이는 하나의 예시일 뿐이며 복수의 게스트 OS를 포함하여 동작할 수 있다. 또한, 도 3의 GPU 가상화 장치(400)는 본 실시예와 관련된 구성요소들만 도시하였으며, 도 2에서 설명한 내용을 포함하는바, 중복되는 내용에 대해서는 설명을 생략하기로 한다. 3, a GPU virtualization device 400 may include a guest OS 410, a host OS 420, and a GPU 430. Although the GPU virtualization apparatus 400 of FIG. 3 is illustrated as including one guest OS 410 for convenience of explanation, this is only an example, and may include a plurality of guest OSes. In addition, the GPU virtualization apparatus 400 of FIG. 3 shows only the components related to the present embodiment and includes the contents described in FIG. 2, and the duplicated description will be omitted.

게스트 OS(410)는 가상 머신 상에서 동작할 수 있으며, 애플리케이션(411), 그래픽 라이브러리(412), 및 가상 GPU 드라이버(413)를 포함할 수 있다. The guest OS 410 may operate on a virtual machine and may include an application 411, a graphics library 412, and a virtual GPU driver 413.

일 실시예로, 게스트 OS(410)는 애플리케이션(411)으로부터 GPU(430) 자원을 사용하여 수행되는 그래픽 처리 명령을 수신하고, 이를 게스트 OS(410)의 그래픽 라이브러리(412)로 전달할 수 있다. 그래픽 라이브러리(412)는 그래픽 처리 명령을 호스트 OS(420)의 GPU API 형식으로 가공할 수 있다. 예를 들어, 그래픽 라이브러리(412)는 소프트웨어적으로 구현된 Mesa 등과 같은 표준 API를 지원하는 OpenGL 라이브러리를 사용할 수 있다. 가상 GPU 드라이버(413)는 그래픽 라이브러리(412)에 의해 가공된 그래픽 처리 명령을 호스트 OS(420)로 전달할 수 있다. 예를 들어, 가상 GPU 드라이버(413)는 게스트 OS(410)와 호스트 OS(420) 간의 반가상화 장치를 지원하는 표준 인터페이스인 Virtual I/O(Virtio) 드라이버를 사용할 수 있다. The guest OS 410 may receive graphics processing instructions that are executed using the GPU 430 resources from the application 411 and may pass it to the graphics library 412 of the guest OS 410. [ The graphics library 412 may process graphics processing instructions into the host OS 420's GPU API format. For example, the graphics library 412 may use OpenGL libraries that support standard APIs such as Mesa, which are implemented in software. The virtual GPU driver 413 can transfer the graphics processing command processed by the graphics library 412 to the host OS 420. [ For example, the virtual GPU driver 413 may use a Virtual I / O (Virtio) driver that is a standard interface for supporting a paravirtualized device between the guest OS 410 and the host OS 420.

호스트 OS(420)는 가상 GPU 드라이버(413)로부터 그래픽 처리 명령을 수신하고, 수신한 그래픽 처리 명령을 기반으로 게스트 OS(410)에게 GPU(430) 자원을 할당할지 여부를 판단하여 GPU(430)에게 그래픽 처리 명령을 요청할 수 있다. The host OS 420 receives the graphics processing command from the virtual GPU driver 413 and determines whether to allocate the GPU 430 resource to the guest OS 410 based on the received graphics processing command, To request a graphics processing command.

보다 구체적으로, 호스트 OS(420)는 하이퍼바이저(421), 그래픽 라이브러리(423), 및 디바이스 드라이버(424)를 포함할 수 있다. 예를 들어, 하이퍼바이저(421)는 도 2에서 설명하는 바와 같이 여러 하이퍼바이저 중 하나를 선택할 수 있으며, 예컨대 QEMU을 사용할 수 있고, 그래픽 라이브러리(423)는 GPU의 종류에 상관없이 필요에 맞게 GPU를 활용할 수 있도록 지원하는 소프트웨어적으로 구현된 Mesa와 같은 표준 라이브러리를 사용하여 동작할 수 있고, 디바이스 드라이버(424)는 GPU와 인터페이스할 수 있도록 지원하는 리눅스 커널의 서브 시스템인 DRM을 사용하여 동작할 수 있다. More specifically, the host OS 420 may include a hypervisor 421, a graphics library 423, and a device driver 424. For example, the hypervisor 421 may select one of a number of hypervisors as described in FIG. 2, and may use, for example, a QEMU, and the graphics library 423 may be a GPU The device driver 424 may be operated using a DRM that is a sub-system of the Linux kernel that supports the interface with the GPU .

일 실시예에 있어서, 게스트 OS(410)의 애플리케이션(411)이 병렬 연산 처리를 수행하는 그래픽 처리 명령을 요청한 경우, 하이퍼바이저(421)는 게스트 OS(410)의 시간 할당량(quota)이 기 설정된 조건을 만족하는지 여부를 판단할 수 있다. 이때, 시간 할당량은 단위 시간 동안 해당 게스트 OS가 GPU 자원을 사용하지 않은 시간의 비율로 정의할 수 있다. 일 실시예로, 시간 t에 i번째 게스트 OS의 시간 할당량을

Figure 112017126798599-pat00001
, i번째 게스트 OS의 자원 배분률을
Figure 112017126798599-pat00002
, 단위 시간 당 시간 할당량에 대한 재생률을 r이라고 정의하면, 시간 할당량은 다음 수학식 1과 같이 계산될 수 있다.In one embodiment, when the application 411 of the guest OS 410 requests a graphics processing instruction to perform parallel computing processing, the hypervisor 421 determines whether the time quota of the guest OS 410 has been set It is possible to judge whether or not the condition is satisfied. In this case, the time quota can be defined as a ratio of the time when the guest OS does not use the GPU resource for a unit time. In one embodiment, the time quota of the i-th guest OS at time t
Figure 112017126798599-pat00001
, the resource allocation rate of the i-th guest OS
Figure 112017126798599-pat00002
, And the reproduction rate with respect to the time allocation per unit time is defined as r, the time allocation can be calculated as shown in the following equation (1).

Figure 112017126798599-pat00003
Figure 112017126798599-pat00003

게스트 OS(410)의 시간 할당량이 기 설정된 조건을 만족하는 경우, 하이퍼바이저(421)는 게스트 OS(410)에 병렬 연산 처리를 수행하는 GPU(430)의 스트림 프로세서를 할당하는 것으로 판단할 수 있다. 일 실시예로, 기 설정된 조건은

Figure 112017126798599-pat00004
로 정의될 수 있다. 하이퍼바이저(421)는 수학식 1에 의해 계산된 게스트 OS(410)의 시간 할당량이
Figure 112017126798599-pat00005
조건을 만족하는 경우에 그래픽 처리 명령을 디바이스 드라이버(424)로 전달하고, 이 명령을 다시 디바이스 드라이버(424)가 GPU(430)로 전달할 수 있다. 이 경우, 게스트 OS(410)는 자신의 시간 할당량 내에서 GPU(430)의 스트림 프로세서를 할당 받아 그래픽 처리 명령을 병렬 연산으로 수행할 수 있다. 그 결과, 게스트 OS(410)의 시간 할당량은 GPU(430)의 스트림 프로세서를 할당 받은 시간만큼 감소된다. 하이퍼바이저(421)는 GPU(430)의 스트림 프로세서를 할당 받은 시간을 반영하여 게스트 OS(410)의 시간 할당량을 재계산할 수 있으며, 재계산된 시간 할당량이 기 설정된 조건을 만족한다면 게스트 OS(410)가 다음 그래픽 처리 명령을 수행할 수 있도록 한다. 또한 하이퍼바이저(421)는 재계산된 시간 할당량이 기 설정된 조건을 만족하지 않는 경우 재생률이 일정하기 때문에 기 설정된 조건을 언제 만족할지 예측 시간을 계산할 수도 있다. 이때, 시간 할당량의 재계산은 특정한 시간 단위로 수행될 수도 있고, 다음 그래픽 처리 명령을 요청 받았을 때에 수행될 수도 있다. When the time allocation amount of the guest OS 410 satisfies the predetermined condition, the hypervisor 421 can determine that the guest OS 410 allocates the stream processor of the GPU 430 performing the parallel operation processing . In one embodiment, the predetermined condition is
Figure 112017126798599-pat00004
. ≪ / RTI > The hypervisor 421 determines whether the time allocation of the guest OS 410 calculated by Equation (1)
Figure 112017126798599-pat00005
If the condition is satisfied, a graphics processing command is sent to the device driver 424 and the device driver 424 can pass the command to the GPU 430 again. In this case, the guest OS 410 can allocate a stream processor of the GPU 430 within its own time allocation amount and perform graphics processing instructions in parallel operation. As a result, the amount of time allocated to the guest OS 410 is reduced by the time that the stream processor of the GPU 430 is allocated. The hypervisor 421 can recalculate the time allocation amount of the guest OS 410 in accordance with the time allocated to the stream processor of the GPU 430. If the recalculated time allocation amount satisfies the predetermined condition, ) To perform the next graphics processing instruction. Also, the hypervisor 421 may calculate the predicted time when the preset condition is satisfied because the recalculation rate is constant if the recalculated time allocation amount does not satisfy the predetermined condition. At this time, the recalculation of the time allocation amount may be performed in a specific time unit, or may be performed when a next graphic processing command is received.

게스트 OS(410)의 시간 할당량이 기 설정된 조건을 만족하지 않는 경우, 하이퍼바이저(421)는 수학식 1에 따라 계산된 게스트 OS(410)의 시간 할당량이 기 설정된 조건(예:

Figure 112017126798599-pat00006
)을 만족할 때까지 그래픽 처리 명령을 디바이스 드라이버(424)로 전달하지 않고 버퍼부(미도시)에 저장할 수 있다.If the time allocation amount of the guest OS 410 does not satisfy the predetermined condition, the hypervisor 421 determines that the time allocation amount of the guest OS 410 calculated according to Equation (1)
Figure 112017126798599-pat00006
) May be stored in the buffer unit (not shown) without passing the graphics processing command to the device driver 424.

한편, GPU에서 처리되는 그래픽 처리 명령의 경우 GPU뿐만 아니라 CPU, 메모리, 작업 부하의 특성 등 여러 가지 요소에 의해서 그래픽 처리 명령의 연산 시간이 영향 받을 수 있기 때문에, 이러한 GPU 자체의 연산 시간을 예측하기 힘들다. 그러나, 상술한 본 발명의 일 실시예에 따른 GPU 자원의 시간 분배 방식은 각각의 가상 머신에 시간 할당량이 남아있을 때에만 해당 가상 머신이 요청한 그래픽 처리 명령을 GPU에 전달하고, 시간 할당량이 남아있지 않을 때에는 시간 할당량이 회복될 때까지 그래픽 처리 명령을 대기시키고 회복된 후에 GPU 자원을 분배한다. 따라서, 본 발명에서는 GPU가 그래픽 처리 명령을 연산하는 데 소요되는 시간을 예측할 필요 없이, 호스트 OS에서 게스트 OS의 시간 할당량만 관리하면 되므로, 구현이 쉬우며 높은 신뢰도를 가질 수 있다. 또한 본 발명의 일 실시예에 따른 GPU 자원의 시간 분배 방식과 비교하여, 스트림 프로세서 자원의 물리적 분배 방식이 있으며 이 방식은 스트림 프로세서의 개수를 기반으로 GPU 자원을 분배하는 방법이다. 예를 들어, 스트림 프로세서가 N개일 때, 40%의 자원 점유율을 갖는 가상 머신에서는 0.4*N개의 스트림 프로세서를 할당 받는다. 이러한 물리적 분배 방식은 정확하게 GPU 자원을 분배하여 사용할 수 있다는 장점이 있으나, GPU 제조사의 디바이스에 관한 정보가 없으면 구현할 수 없다. 그러나 본 발명에 따른 GPU 자원의 시간 분배 방식의 경우, GPU에 관한 정보 없이도 게스트 OS의 시간 할당량 정보만 계산하면 되므로 어떠한 GPU에 대해서도 구현할 수 있는 장점이 있다. On the other hand, in the case of the graphics processing instruction processed by the GPU, since the computing time of the graphics processing instruction may be influenced not only by the GPU but also by various factors such as the CPU, memory, and workload characteristics, Hard. However, according to the time distribution method of GPU resources according to the embodiment of the present invention, only when a time allocation amount remains in each virtual machine, the graphics processing command requested by the corresponding virtual machine is transmitted to the GPU, If not, it waits for a graphics processing instruction until the time quota is restored and distributes the GPU resources after recovery. Therefore, in the present invention, since only the time allocation amount of the guest OS is managed in the host OS without having to predict the time required for the GPU to calculate the graphics processing command, the implementation is easy and high reliability can be obtained. Also, there is a physical distribution method of stream processor resources in comparison with the time distribution method of GPU resources according to an embodiment of the present invention. This method is a method of distributing GPU resources based on the number of stream processors. For example, when there are N stream processors, 0.4 * N stream processors are allocated in a virtual machine with 40% resource occupancy. This physical distribution scheme has the advantage of being able to distribute GPU resources accurately, but it can not be implemented without information about the devices of the GPU manufacturer. However, in the case of the time distribution method of the GPU resources according to the present invention, since only the time quota information of the guest OS is calculated without information about the GPU, there is an advantage that it can be implemented for any GPU.

다른 실시예에 있어서, 게스트 OS(410)의 애플리케이션(411)이 GPU(430)의 메모리 자원에 접근을 시도하는 그래픽 처리 명령을 요청한 경우, 호스트 OS(420)의 그래픽 라이브러리(423)는 그래픽 처리 명령을 수행하는데 따른 GPU(430)의 메모리 사용량이 게스트 OS(410)에 할당된 GPU(430)의 메모리량을 초과하는지 여부를 판단할 수 있다. 판단 결과에 따라 그래픽 라이브러리(423)는 그래픽 처리 명령을 제어할 수 있다. In another embodiment, if the application 411 of the guest OS 410 requests a graphics processing instruction to access memory resources of the GPU 430, the graphics library 423 of the host OS 420 may perform graphics processing It is possible to determine whether the memory usage of the GPU 430 in accordance with the execution of the command exceeds the memory amount of the GPU 430 allocated to the guest OS 410. [ The graphic library 423 can control the graphic processing command according to the determination result.

그래픽 처리 명령을 수행하는 데 따른 GPU(430)의 메모리 사용량이 게스트 OS(410)에 할당된 GPU(430)의 메모리량을 초과하지 않는 경우, 그래픽 라이브러리(423)는 그래픽 처리 명령을 디바이스 드라이버(424)로 전달할 수 있다. 이 경우, 게스트 OS(410)는 GPU(430)의 메모리 자원을 할당 받아 그래픽 처리 명령을 수행할 수 있다. If the memory usage of the GPU 430 due to performing the graphics processing command does not exceed the amount of memory of the GPU 430 allocated to the guest OS 410, the graphics library 423 sends graphics processing instructions to the device driver 424, respectively. In this case, the guest OS 410 can allocate memory resources of the GPU 430 and execute graphics processing instructions.

그래픽 처리 명령을 수행하는 데 따른 GPU(430)의 메모리 사용량이 게스트 OS(410)에 할당된 GPU(430)의 메모리량을 초과하는 경우, 그래픽 라이브러리(423)는 그래픽 처리 명령을 디바이스 드라이버(424)로 전달하지 못하도록 제어할 수 있다. 이 경우, 게스트 OS(410)는 GPU(430)의 메모리 자원을 할당 받지 못하여 그래픽 처리 명령을 처리할 수 없다. 이러한 과정을 통해 게스트 OS(410)는 자신에게 할당된 메모리 자원을 초과하지 않고 허용된 자원만 사용할 수 있다. If the memory usage of the GPU 430 due to performing the graphics processing instructions exceeds the amount of memory of the GPU 430 allocated to the guest OS 410, the graphics library 423 sends graphics processing instructions to the device driver 424 ) To be transmitted. In this case, the guest OS 410 can not allocate the memory resources of the GPU 430 and can not process the graphics processing command. Through this process, the guest OS 410 can use only the permitted resources without exceeding the memory resources allocated to the guest OS 410. [

또한, 본 발명의 일 실시예에 따른 GPU의 메모리 분배 방식에서는 게스트 OS(410)가 자체적으로 메모리 관리를 하도록 할 수 있다. 일 실시예로, 게스트 OS(410)가 가상 GPU 드라이버(413)를 로딩할 때 자신에게 할당된 GPU(430)의 메모리량을 파악할 수 있도록 설치될 수 있다. 예를 들어, 실제 GPU(430)의 메모리가 8GB이고 전체 머신 상에서 하나의 가상 머신의 점유율이 40%인 경우, 해당 가상 머신은 3.2GB의 GPU(430)의 메모리를 할당 받을 수 있고 가상 GPU 드라이버(413)를 통해 자신의 메모리 할당량을 알 수 있다. 본 발명의 일 실시예에 따르면, 게스트 OS(410)가 애플리케이션(411)으로부터 GPU(430)의 메모리 자원에 접근을 시도하는 그래픽 처리 명령을 수신한 경우, 이 명령을 호스트 OS(420)로 전달하기 전에 가상 GPU 드라이버(413)로 전달한다. 가상 GPU 드라이버(413)는 게스트 OS(410)에 할당된 GPU(430)의 메모리량을 확인하여, 그래픽 처리 명령을 수행하는데 따른 GPU(430)의 메모리 사용량과 비교할 수 있다. 비교 결과에 따라 가상 GPU 드라이버(413)는 그래픽 처리 명령을 호스트 OS(420)로 전달할지 여부를 결정할 수 있다. 그래픽 처리 명령이 호스트 OS(420) 측으로 전달된 경우, 호스트 OS(420) 측에서의 GPU(430)의 메모리 자원 할당 과정은 그래픽 라이브러리(423)에서 설명한 바와 같이 수행될 수 있다. In addition, in the memory distribution method of the GPU according to the embodiment of the present invention, the guest OS 410 can perform memory management by itself. In one embodiment, the guest OS 410 may be installed so as to grasp the amount of memory of the GPU 430 allocated to the guest OS 410 when the virtual GPU driver 413 is loaded. For example, if the memory of the actual GPU 430 is 8 GB and the occupancy rate of one virtual machine on the whole machine is 40%, the virtual machine can be allocated the memory of the 3.2 GB GPU 430, The user can know his / her memory allocation amount through the memory 413. According to one embodiment of the present invention, when the guest OS 410 receives a graphics processing command from an application 411 that attempts to access memory resources of the GPU 430, it sends this command to the host OS 420 To the virtual GPU driver 413 before doing so. The virtual GPU driver 413 can check the amount of memory of the GPU 430 allocated to the guest OS 410 and compare the amount of memory of the GPU 430 with the amount of memory used by the GPU 430 for executing the graphics processing command. According to the comparison result, the virtual GPU driver 413 can determine whether to transmit the graphic processing command to the host OS 420. [ When the graphics processing command is transmitted to the host OS 420, the memory resource allocation process of the GPU 430 on the host OS 420 side may be performed as described in the graphic library 423.

상술한 바와 같이 본 발명의 일 실시예에 따르면, 가상 머신 상에서 자신이 할당 받은 GPU 메모리량을 가상 GPU 드라이버를 통해 보여줌으로써, 가상 머신 상에서 실행되는 소프트웨어가 자체적으로 메모리 관리를 하도록 유도할 수 있다. 따라서 클라우드 환경과 같이 고성능의 소프트웨어(예: 시뮬레이션, 게임 등)를 실행하는 환경에서 본 발명을 적용할 경우, 먼저 게스트 OS에서 자체적으로 GPU 메모리 한도를 넘지 않도록 관리할 수 있어서 GPU-CPU 메모리 스왑(swap) 등의 문제로 성능이 떨어지지 않도록 예방할 수 있다. As described above, according to the embodiment of the present invention, the amount of the GPU memory allocated to the virtual machine is displayed through the virtual GPU driver on the virtual machine, so that the software running on the virtual machine can induce memory management by itself. Therefore, when the present invention is applied to an environment in which high-performance software such as a cloud environment (for example, simulation, game, etc.) is executed, the guest OS can manage the GPU- swap) to prevent performance degradation.

도 4는 본 발명의 일 실시예에 따른 반가상화 기법를 이용한 GPU 자원 관리 방법을 나타낸 순서도이다. 도 4의 방법은 상술한 도 2 및 도 3의 GPU 가상화 장치에 의해 수행될 수 있으며, 본 실시예에서는 설명의 편의를 위해서 도 3의 GPU 가상화 장치를 참조하여 설명한다. 4 is a flowchart illustrating a GPU resource management method using a paravirtualization technique according to an embodiment of the present invention. The method of FIG. 4 may be performed by the GPU virtualization apparatuses of FIGS. 2 and 3 described above. In this embodiment, the GPU virtualization apparatus of FIG. 3 will be described for convenience of explanation.

도 4를 참조하면, 게스트 OS(410)는 애플리케이션(411)으로부터 생성된 그래픽 처리 명령 요청을 수신할 수 있다(S500). 게스트 OS(410)의 그래픽 라이브러리(412)는 수신한 그래픽 처리 명령 요청을 호스트 OS(420)의 GPU API 형식으로 가공할 수 있다(S510). 게스트 OS(410)의 가상 GPU 드라이버(413)는 가공된 그래픽 처리 명령 요청을 호스트 OS(420)로 전달할 수 있다(S520). 이때, 호스트 OS(420)의 GPU API 컨버터(422)는 그래픽 처리 명령 요청을 호스트 OS(420)의 그래픽 스택에서 이해할 수 있는 형태로 변경할 수 있고, 변경된 형태의 그래픽 처리 명령 요청을 호스트 OS(420)의 하이퍼바이저(421)로 전달할 수 있다. Referring to FIG. 4, the guest OS 410 may receive a graphics processing instruction request generated from the application 411 (S500). The graphic library 412 of the guest OS 410 may process the received graphics processing command request into the GPU API format of the host OS 420 (S510). The virtual GPU driver 413 of the guest OS 410 may forward the processed graphics processing instruction request to the host OS 420 (S520). At this time, the GPU API converter 422 of the host OS 420 can change the graphics processing command request to a form understandable in the graphic stack of the host OS 420, and send the graphics processing command request of the changed form to the host OS 420 To the hypervisor 421 of FIG.

실시예에 따라, 게스트 OS(410)의 그래픽 라이브러리(412)는 호스트 OS(420)의 그래픽 스택에서 이해할 수 있는 형태로 그래픽 처리 명령 요청을 전달할 수 있다. 이 경우 GPU API 컨버터(422)에서 게스트 OS(410)의 그래픽 처리 명령 요청을 변환할 필요는 없다. 다른 실시예에 있어서, 게스트 OS(410)의 그래픽 라이브러리(412)에서 호스트 OS(420)에서 처리하는 형태와 상이한 별도의 중간 형태, 예를 들어 IR(Intermediate representation)으로 그래픽 처리 명령 요청을 생성하여 호스트 OS(420)로 전달할 수 있다. IR의 대표적인 규격으로는 TGSI(Tungsten Graphics Shader Infrastructure)가 있다. 이 경우에 GPU API 컨버터(422)는 게스트 OS(410)로부터 수신한 그래픽 처리 명령 요청을 호스트 OS(420)의 그래픽 스택에서 이해할 수 있는 형태로 변경하여 하이퍼바이저(421)로 전달할 수 있다.In accordance with an embodiment, the graphics library 412 of the guest OS 410 may communicate a graphics processing instruction request in a form that is understandable in the graphics stack of the host OS 420. In this case, it is not necessary to convert the graphics processing instruction request of the guest OS 410 in the GPU API converter 422. In another embodiment, a graphics processing instruction request is generated in a separate intermediate form, such as an IR (Intermediate representation), different from that processed by the host OS 420 in the graphics library 412 of the guest OS 410 To the host OS 420. A typical specification of IR is Tungsten Graphics Shader Infrastructure (TGSI). In this case, the GPU API converter 422 may convert the graphics processing command request received from the guest OS 410 into a form understandable in the graphics stack of the host OS 420 and deliver it to the hypervisor 421.

호스트 OS(420)는 게스트 OS(410)의 가상 GPU 드라이버(413)로부터 수신한 그래픽 처리 명령 요청을 기반으로 게스트 OS(410)에게 GPU(430) 자원을 할당할지 여부를 판단할 수 있다(S530). 판단 결과에 따라, 호스트 OS(420)는 그래픽 처리 명령 요청을 GPU(430)로 전달할 수 있다(S540). The host OS 420 may determine whether to allocate the GPU 430 resource to the guest OS 410 based on the graphic processing command request received from the virtual GPU driver 413 of the guest OS 410 ). According to the determination result, the host OS 420 may transmit a graphic processing command request to the GPU 430 (S540).

일 실시예에 있어서, 게스트 OS(410)의 애플리케이션(411)이 병렬 연산 처리를 수행하는 그래픽 처리 명령을 요청한 경우, 호스트 OS(420)의 하이퍼바이저(421)는 게스트 OS(410)의 시간 할당량이 기 설정된 조건을 만족하는지 여부를 판단할 수 있다. 판단 결과에 따라, 하이퍼바이저(421)는 게스트 OS(410)에 병렬 연산 처리를 수행하는 GPU(430)의 스트림 프로세서를 할당할지 결정할 수 있다. In one embodiment, when the application 411 of the guest OS 410 requests a graphics processing instruction to perform a parallel computing process, the hypervisor 421 of the host OS 420 determines the time quota of the guest OS 410 It can be determined whether or not the predetermined condition is satisfied. According to the determination result, the hypervisor 421 can determine whether to allocate the stream processor of the GPU 430 that performs the parallel operation processing to the guest OS 410. [

다른 실시예에 있어서, 게스트 OS(410)의 애플리케이션(411)이 GPU(430)의 메모리 자원에 접근을 시도하는 그래픽 처리 명령을 요청한 경우, 호스트 OS(420)의 그래픽 라이브러리(423)는 그래픽 처리 명령을 수행하는데 따른 GPU(430)의 메모리 사용량이 게스트 OS(410)에 할당된 GPU(430)의 메모리량을 초과하는지 여부를 판단할 수 있다. 판단 결과에 따라, 그래픽 라이브러리(423)는 그래픽 처리 명령을 디바이스 드라이버(424)로 전달할지 제어할 수 있으며, 제어에 따라 GPU(430)의 메모리 자원의 할당을 결정할 수 있다. In another embodiment, if the application 411 of the guest OS 410 requests a graphics processing instruction to access memory resources of the GPU 430, the graphics library 423 of the host OS 420 may perform graphics processing It is possible to determine whether the memory usage of the GPU 430 in accordance with the execution of the command exceeds the memory amount of the GPU 430 allocated to the guest OS 410. [ According to the determination result, the graphic library 423 can control whether to transfer the graphics processing command to the device driver 424, and can determine the allocation of the memory resource of the GPU 430 according to the control.

각 단계에서 수행되는 과정에 대해서는 도 2 및 도 3을 참조하여 상세히 설명한 바 있으므로, 본 실시예에서는 구체적인 설명을 생략하도록 한다. The process performed in each step has been described in detail with reference to FIG. 2 and FIG. 3. Therefore, a detailed description thereof will be omitted in the present embodiment.

상술한 본 발명에 따른 방법은 또한 컴퓨터로 읽을 수 있는 기록 매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록 매체는 마그네틱 저장 매체, 광학적 판독 매체 등 모든 물리적인 저장매체를 포함한다. 또한, 본 발명에서 사용되는 메시지의 데이터 포맷을 기록 매체에 기록하는 것이 가능하다. The above-described method according to the present invention can also be implemented as computer-readable codes on a computer-readable recording medium. Computer-readable recording media include all physical storage media such as magnetic storage media, optical reading media, and the like. It is also possible to record the data format of the message used in the present invention on a recording medium.

지금까지 본 발명에 대하여 도면에 도시된 바람직한 실시예들을 중심으로 상세히 살펴보았다. 이러한 실시예들은 이 발명을 한정하려는 것이 아니라 예시적인 것에 불과하며, 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 진정한 기술적 보호범위는 전술한 설명이 아니라 첨부된 특허청구범위의 기술적 사상에 의해서 정해져야 할 것이다. 비록 본 명세서에 특정한 용어들이 사용되었으나 이는 단지 본 발명의 개념을 설명하기 위한 목적에서 사용된 것이지 의미한정이나 특허청구범위에 기재된 본 발명의 범위를 제한하기 위하여 사용된 것은 아니다. 본 발명의 각 단계는 반드시 기재된 순서대로 수행되어야 할 필요는 없고, 병렬적, 선택적 또는 개별적으로 수행될 수 있다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 특허청구범위에서 청구하는 본 발명의 본질적인 기술사상에서 벗어나지 않는 범위에서 다양한 변형 형태 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. 균등물은 현재 공지된 균등물뿐만 아니라 장래에 개발될 균등물 즉 구조와 무관하게 동일한 기능을 수행하도록 발명된 모든 구성요소를 포함하는 것으로 이해되어야 한다.The present invention has been described in detail with reference to the preferred embodiments shown in the drawings. These embodiments are to be considered as illustrative rather than limiting, and should be considered in an illustrative rather than a restrictive sense. The true scope of protection of the present invention should be determined by the technical idea of the appended claims rather than the above description. Although specific terms are used herein, they are used for the purpose of describing the concept of the present invention only and are not used to limit the scope of the present invention described in the claims or the claims. Each step of the present invention need not necessarily be performed in the order described, but may be performed in parallel, selectively, or individually. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. It is to be understood that the equivalents include all components that are invented in order to perform the same function irrespective of the currently known equivalents as well as the equivalents to be developed in the future.

Claims (19)

가상화 환경에서의 GPU(Graphics Processing Unit) 자원 관리 방법에 있어서,
호스트 OS(Operating System)가 복수의 게스트 OS 중 적어도 하나의 게스트 OS로부터 그래픽 처리 명령 요청을 수신하는 단계;
상기 호스트 OS가 상기 그래픽 처리 명령 요청을 기반으로 상기 게스트 OS에게 GPU 자원을 할당할지 여부를 판단하는 단계; 및
상기 판단 결과에 따라 상기 호스트 OS가 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하는 단계를 포함하며,
상기 GPU 자원을 할당할지 여부를 판단하는 단계는,
상기 그래픽 처리 명령 요청이 병렬 연산 처리를 수행하는 경우, 상기 호스트 OS가 상기 게스트 OS의 시간 할당량(quota)이 기 설정된 조건을 만족하는지 여부를 판단하는 단계; 및
상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는 경우, 상기 게스트 OS에 상기 병렬 연산 처리를 위한 GPU의 스트림 프로세서를 할당하는 것으로 판단하며, 상기 게스트 OS에 상기 GPU의 스트림 프로세서를 할당한 결과에 따라, 상기 GPU의 스트림 프로세서의 할당 시간을 반영하여 상기 게스트 OS의 시간 할당량을 재계산하고, 상기 재계산된 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는지 판단하는 단계를 포함하는 것을 특징으로 하는 GPU 자원 관리 방법.
A method of managing GPU (Graphics Processing Unit) resources in a virtualized environment,
The method comprising: receiving a graphics processing instruction request from a guest OS of at least one of a plurality of guest OSs;
Determining whether the host OS allocates GPU resources to the guest OS based on the graphics processing instruction request; And
And forwarding the graphics processing instruction request to the GPU by the host OS according to the determination result,
Wherein the determining whether to allocate the GPU resource comprises:
Determining whether a quota of the guest OS satisfies a predetermined condition when the graphic processing command request performs parallel computing processing; And
If the time allocation amount of the guest OS satisfies a predetermined condition, it is determined that the stream processor of the GPU for parallel operation processing is allocated to the guest OS, and the result of allocating the stream processor of the GPU to the guest OS Calculating a time allocation amount of the guest OS by reflecting the allocation time of the stream processor of the GPU and determining whether the time allocation amount of the re-calculated guest OS satisfies a preset condition How to manage GPU resources.
삭제delete 삭제delete 제1항에 있어서,
상기 GPU 자원을 할당할지 여부를 판단하는 단계는,
상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하지 않는 경우, 상기 게스트 OS의 GPU 자원 배분율 및 상기 GPU 자원에 대한 단위 시간당 시간 할당량의 재생률을 기반으로 상기 게스트 OS의 시간 할당량이 상기 기 설정된 조건을 만족할 때까지 상기 그래픽 처리 명령 요청을 저장하는 단계를 포함하는 것을 특징으로 하는 GPU 자원 관리 방법.
The method according to claim 1,
Wherein the determining whether to allocate the GPU resource comprises:
If the time allocation amount of the guest OS does not meet the predetermined condition, the time allocation amount of the guest OS is updated based on the GPU resource allocation rate of the guest OS and the playback rate of the time allocation amount per unit time with respect to the GPU resource And storing the graphics processing instruction request until it is satisfied.
제1항에 있어서,
상기 GPU 자원을 할당할지 여부를 판단하는 단계는,
상기 그래픽 처리 명령 요청이 GPU의 메모리 접근을 시도하는 경우,
상기 호스트 OS의 그래픽 라이브러리가 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는지 여부를 판단하는 단계를 포함하는 것을 특징으로 하는 GPU 자원 관리 방법.
The method according to claim 1,
Wherein the determining whether to allocate the GPU resource comprises:
If the graphics processing instruction request attempts to access the GPU's memory,
And determining whether the memory usage of the GPU according to the graphics processing instruction request exceeds the memory amount of the GPU allocated to the guest OS by the graphics library of the host OS.
제5항에 있어서,
상기 GPU 자원을 할당할지 여부를 판단하는 단계는,
상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하지 않는 경우, 상기 호스트 OS의 그래픽 라이브러리가 상기 그래픽 처리 명령 요청을 상기 호스트 OS의 디바이스 드라이버로 전달하는 단계를 포함하는 것을 특징으로 하는 GPU 자원 관리 방법.
6. The method of claim 5,
Wherein the determining whether to allocate the GPU resource comprises:
If the memory usage of the GPU according to the graphics processing instruction request does not exceed the memory amount of the GPU allocated to the guest OS, the graphics library of the host OS forwards the graphics processing command request to the device driver of the host OS The GPU resource management method comprising:
제5항에 있어서,
상기 GPU 자원을 할당할지 여부를 판단하는 단계는,
상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는 경우, 상기 호스트 OS의 그래픽 라이브러리가 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하지 못하도록 제어하는 단계를 포함하는 것을 특징으로 하는 GPU 자원 관리 방법.
6. The method of claim 5,
Wherein the determining whether to allocate the GPU resource comprises:
Controlling to prevent the graphics library of the host OS from forwarding the graphics processing instruction request to the GPU when the memory usage of the GPU according to the graphics processing instruction request exceeds the amount of memory of the GPU allocated to the guest OS The GPU resource management method comprising:
제5항에 있어서,
상기 게스트 OS의 가상 GPU 드라이버가 애플리케이션으로부터 상기 그래픽 처리 명령 요청을 수신하는 단계;
상기 게스트 OS의 가상 GPU 드라이버가 상기 게스트 OS에 할당된 GPU의 메모리량을 확인하여, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량과 비교하는 단계; 및
상기 비교 결과에 따라, 상기 게스트 OS의 가상 GPU 드라이버가 상기 그래픽 처리 명령 요청을 상기 호스트 OS로 전달할지 여부를 결정하는 단계를 더 포함하는 것을 특징으로 하는 GPU 자원 관리 방법.
6. The method of claim 5,
The virtual GPU driver of the guest OS receiving the graphics processing instruction request from an application;
The virtual GPU driver of the guest OS checks the memory amount of the GPU allocated to the guest OS and compares the memory amount with the memory usage amount of the GPU according to the graphic processing command request; And
Further comprising determining whether the virtual GPU driver of the guest OS transfers the graphics processing instruction request to the host OS according to the comparison result.
제1항에 있어서,
상기 게스트 OS가 애플리케이션으로부터 생성된 상기 그래픽 처리 명령 요청을 수신하는 단계;
상기 게스트 OS의 그래픽 라이브러리가 상기 수신한 그래픽 처리 명령 요청을 상기 호스트 OS의 GPU API 형식으로 가공하는 단계; 및
상기 게스트 OS의 가상 GPU 드라이버가 상기 가공된 그래픽 처리 명령 요청을 상기 호스트 OS로 전달하는 단계를 더 포함하는 것을 특징으로 하는 GPU 자원 관리 방법.
The method according to claim 1,
The guest OS receiving the graphics processing instruction request generated from an application;
Processing the received graphics processing command request into the GPU API format of the host OS by the graphics library of the guest OS; And
And the virtual GPU driver of the guest OS transfers the processed graphics processing instruction request to the host OS.
애플리케이션으로부터 생성된 그래픽 처리 명령 요청을 호스트 OS로 전달하는 게스트 OS; 및
상기 그래픽 처리 명령 요청을 기반으로 상기 게스트 OS에게 GPU 자원을 할당할지 여부를 판단하고, 상기 판단 결과에 따라 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하는 호스트 OS를 포함하며,
상기 호스트 OS는,
상기 그래픽 처리 명령 요청이 병렬 연산 처리를 수행하는 경우, 상기 게스트 OS의 시간 할당량(quota)이 기 설정된 조건을 만족하는지 여부를 판단하고,
상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는 경우, 상기 게스트 OS에 상기 병렬 연산 처리를 수행하는 GPU의 스트림 프로세서를 할당하는 것으로 판단하며,
상기 게스트 OS에 상기 GPU의 스트림 프로세서를 할당한 결과에 따라, 상기 GPU의 스트림 프로세서의 할당 시간을 반영하여 상기 게스트 OS의 시간 할당량을 재계산하고, 상기 재계산된 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하는지 판단하는 것을 특징으로 하는 GPU 가상화 장치.
A guest OS for delivering a graphics processing instruction request generated from an application to a host OS; And
And a host OS for determining whether to allocate GPU resources to the guest OS based on the request for the graphics processing command and delivering the graphics processing command request to the GPU according to the determination result,
The host OS,
When the graphic processing command request performs parallel computing processing, it is determined whether the time quota of the guest OS satisfies a predetermined condition,
And determines that the stream processor of the GPU performing the parallel operation processing is allocated to the guest OS when the time allocation amount of the guest OS satisfies the predetermined condition,
Calculating a time allocation amount of the guest OS by reflecting the allocation time of the stream processor of the GPU according to a result of allocating the stream processor of the GPU to the guest OS, And determines whether the condition is satisfied.
삭제delete 삭제delete 제10항에 있어서,
상기 호스트 OS는,
상기 게스트 OS의 시간 할당량이 기 설정된 조건을 만족하지 않는 경우, 상기 게스트 OS의 GPU 자원 배분율 및 상기 GPU 자원에 대한 단위 시간당 시간 할당량의 재생률을 기반으로 상기 게스트 OS의 시간 할당량이 상기 기 설정된 조건을 만족할 때까지 상기 그래픽 처리 명령 요청을 저장하는 버퍼부를 포함하는 것을 특징으로 하는 GPU 가상화 장치.
11. The method of claim 10,
The host OS,
If the time allocation amount of the guest OS does not meet the predetermined condition, the time allocation amount of the guest OS is updated based on the GPU resource allocation rate of the guest OS and the playback rate of the time allocation amount per unit time with respect to the GPU resource And a buffer unit for storing the graphic processing command request until it is satisfied.
제10항에 있어서,
상기 호스트 OS는,
상기 그래픽 처리 명령 요청이 GPU의 메모리 접근을 시도하는 경우,
상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는지 여부를 판단하는 그래픽 라이브러리를 포함하는 것을 특징으로 하는 GPU 가상화 장치.
11. The method of claim 10,
The host OS,
If the graphics processing instruction request attempts to access the GPU's memory,
And a graphics library for determining whether the memory usage of the GPU according to the graphics processing instruction request exceeds a memory amount of the GPU allocated to the guest OS.
제14항에 있어서,
상기 그래픽 라이브러리는,
상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하지 않는 경우, 상기 그래픽 처리 명령 요청을 상기 호스트 OS의 디바이스 드라이버로 전달하는 것을 특징으로 하는 GPU 가상화 장치.
15. The method of claim 14,
The graphic library includes:
And when the memory usage of the GPU according to the graphic processing command request does not exceed the memory amount of the GPU allocated to the guest OS, the graphic processing command request is transmitted to the device driver of the host OS. Device.
제14항에 있어서,
상기 그래픽 라이브러리는,
상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량이 상기 게스트 OS에 할당된 GPU의 메모리량을 초과하는 경우, 상기 그래픽 처리 명령 요청을 상기 GPU로 전달하지 못하도록 제어하는 것을 특징으로 하는 GPU 가상화 장치.
15. The method of claim 14,
The graphic library includes:
And controls the GPU not to forward the graphic processing command request to the GPU when the memory usage of the GPU according to the graphic processing command request exceeds the memory amount of the GPU allocated to the guest OS.
제14항에 있어서,
상기 게스트 OS는,
애플리케이션으로부터 상기 그래픽 처리 명령 요청을 수신하고,
상기 게스트 OS에 할당된 GPU의 메모리량을 확인하여, 상기 그래픽 처리 명령 요청에 따른 상기 GPU의 메모리 사용량과 비교하고,
상기 비교 결과에 따라, 상기 그래픽 처리 명령 요청을 상기 호스트 OS로 전달할지 여부를 결정하는 가상 GPU 드라이버를 포함하는 것을 특징으로 하는 GPU 가상화 장치.
15. The method of claim 14,
The guest OS,
Receiving the graphics processing instruction request from an application,
Comparing a memory usage of the GPU allocated to the guest OS with a memory usage amount of the GPU according to the graphics processing instruction request,
And a virtual GPU driver for determining whether to transmit the graphic processing command request to the host OS according to the comparison result.
제17항에 있어서,
상기 게스트 OS는,
애플리케이션으로부터 생성된 상기 그래픽 처리 명령 요청을 수신하고,
상기 수신한 그래픽 처리 명령 요청을 상기 호스트 OS의 GPU API 형식으로 가공하는 그래픽 라이브러리를 포함하며,
상기 가상 GPU 드라이버는,
상기 가공된 그래픽 처리 명령 요청을 상기 호스트 OS로 전달하는 것을 특징으로 하는 GPU 가상화 장치.
18. The method of claim 17,
The guest OS,
Receiving the graphics processing instruction request generated from the application,
And a graphics library for processing the received graphics processing command request into the GPU API format of the host OS,
The virtual GPU driver,
And delivers the processed graphics processing instruction request to the host OS.
제1항, 제4항 내지 제9항 중 어느 한 항의 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium storing a program for causing a computer to execute the method according to any one of claims 1 to 9.
KR1020170175585A 2017-12-19 2017-12-19 Method and apparatus for managing gpu resource in virtualization environment KR102001641B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170175585A KR102001641B1 (en) 2017-12-19 2017-12-19 Method and apparatus for managing gpu resource in virtualization environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170175585A KR102001641B1 (en) 2017-12-19 2017-12-19 Method and apparatus for managing gpu resource in virtualization environment

Publications (2)

Publication Number Publication Date
KR20190074165A KR20190074165A (en) 2019-06-27
KR102001641B1 true KR102001641B1 (en) 2019-07-18

Family

ID=67057074

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170175585A KR102001641B1 (en) 2017-12-19 2017-12-19 Method and apparatus for managing gpu resource in virtualization environment

Country Status (1)

Country Link
KR (1) KR102001641B1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102417882B1 (en) * 2020-09-14 2022-07-05 한화시스템 주식회사 Method for managing gpu resources and computing device for executing the method
AU2021106788A4 (en) * 2021-08-24 2021-11-18 Radian Arc Limited A computer system and computer implemented method for gaming in a virtualisation environment
CN116402674A (en) * 2023-04-03 2023-07-07 摩尔线程智能科技(北京)有限责任公司 GPU command processing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101401523B1 (en) * 2013-02-08 2014-06-03 한국과학기술정보연구원 A coarse-grained sharing gpu scheduling method and apparatus among virtual machines
JP2017091154A (en) 2015-11-09 2017-05-25 日本電気株式会社 Virtual base host, method for controlling virtual base host, virtual base host program, and communication system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8274518B2 (en) * 2004-12-30 2012-09-25 Microsoft Corporation Systems and methods for virtualizing graphics subsystems
KR102358752B1 (en) * 2015-03-17 2022-02-07 엘지전자 주식회사 Method for virtualization of graphic processing unit in mobile environment and recoding medium thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101401523B1 (en) * 2013-02-08 2014-06-03 한국과학기술정보연구원 A coarse-grained sharing gpu scheduling method and apparatus among virtual machines
JP2017091154A (en) 2015-11-09 2017-05-25 日本電気株式会社 Virtual base host, method for controlling virtual base host, virtual base host program, and communication system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
주영현 외 2명. 'OpenGL 그래픽 성능 향상을 위한 장치 가상화 프레임 워크'. 정보과학회논문지: 컴퓨팅의 실제 및 레터 제20권 제3호, 2014.03., pp.201-205.

Also Published As

Publication number Publication date
KR20190074165A (en) 2019-06-27

Similar Documents

Publication Publication Date Title
EP2622470B1 (en) Techniques for load balancing gpu enabled virtual machines
US10362101B2 (en) Mechanism for providing load balancing to an external node utilizing a clustered environment for storage management
US10241709B2 (en) Elastic temporary filesystem
US10310879B2 (en) Paravirtualized virtual GPU
US10162658B2 (en) Virtual processor allocation techniques
US9406099B2 (en) Methods and systems for maintaining state in a virtual machine when disconnected from graphics hardware
US9268394B2 (en) Virtualized application power budgeting
US10191759B2 (en) Apparatus and method for scheduling graphics processing unit workloads from virtual machines
JP4921384B2 (en) Method, apparatus and system for dynamically reallocating memory from one virtual machine to another
US20120054740A1 (en) Techniques For Selectively Enabling Or Disabling Virtual Devices In Virtual Environments
US20130174151A1 (en) Information processing apparatus and method of controlling virtual machine
US20240054006A1 (en) Virtualization processing system, method and apparatus, and device
KR102001641B1 (en) Method and apparatus for managing gpu resource in virtualization environment
WO2023093843A1 (en) Configuration device, scheduling device, configuration method, and scheduling method
WO2023050819A1 (en) System on chip, virtual machine task processing method and device, and storage medium
EP3701373B1 (en) Virtualization operations for directly assigned devices
WO2016101282A1 (en) Method, device and system for processing i/o task
US9158554B2 (en) System and method for expediting virtual I/O server (VIOS) boot time in a virtual computing environment
Kamoun Virtualizing the datacenter without compromising server performance
US8402191B2 (en) Computing element virtualization
US9740514B1 (en) Method and system to share data with snapshots in a virtualization environment
JP6653786B2 (en) I / O control method and I / O control system
Zhang et al. NVMe-over-RPMsg: A virtual storage device model applied to heterogeneous multi-core SoCs
Kukreja et al. Virtio based transcendent memory
US20240152462A1 (en) Centralized, scalable cache for containerized applications in a virtualized environment

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right