Doc: Grammatical edits to GVT-d docs.

Signed-off-by: Deb Taylor <deb.taylor@intel.com>
This commit is contained in:
Deb Taylor 2020-05-21 17:04:25 -04:00 committed by deb-intel
parent 102aba8bc8
commit c606d060ec
2 changed files with 180 additions and 163 deletions

View File

@ -1,22 +1,21 @@
.. _gpu-passthrough:
Enable GVT-d in ACRN
#########################################
####################
This tutorial describes how to enable GVT-d in ACRN.
.. note:: It is recommended to have either a serial port
.. note:: After GVT-d is enabled, have either a serial port
or SSH session open in the Service VM to be able to
continue interact with it after enabling GVT-d.
continue interact with it.
Introduction
*****************
Intel GVT-d is one flavor of graphics virtualization approaches also
names as Intel-Graphics-Device pass-through feature.
It based on Intel VT-d technology,
and some special graphics related configuration.
This flavor allows direct assignment of an entire GPUs prowess to a single user,
passing the native driver capabilities through the hypervisor without any limitations.
************
Intel GVT-d is a graphics virtualization approach that is also known as
the Intel-Graphics-Device passthrough feature. Based on Intel VT-d technology, it offers useful special graphics-related configurations.
It allows for direct assignment of an entire GPUs prowess to a single user,
passing the native driver capabilities through to the hypervisor without any limitations.
Verified version
*****************
@ -26,35 +25,40 @@ Verified version
- ACRN-EDK2 (OVMF): **ovmf-acrn** branch, commit id **0ff86f6b9a3500e4c7ea0c1064e77d98e9745947**
Prerequisites
*****************
*************
Follow :ref:`these instructions <kbl-nuc-sdc>` to set up the ACRN Service VM.
Hardware Platform Supported
Supported hardware platform
***************************
Currently, ACRN has enabled GVT-d on the following platforms:
* Kaby Lake
* Whiskey Lake
* Elkhart Lake
BIOS Setting
**********************
BIOS settings
*************
Kaby Lake Platform
Kaby Lake platform
==================
* set "IGD Minimum Memory" to "64MB" in "Devices → Video → IGD Minimum Memory".
Whiskey Lake Platform
* Set **IGD Minimum Memory** to **64MB** in **Devices** → **Video** → **IGD Minimum Memory**.
Whiskey Lake platform
=====================
* set "PM Support" to "Enabled" in "chipset → System Agent (SA) Configuration → Graphics Configuration → PM support".
* set "DVMT Pre-Allocated" to "64MB" in "chipset → System Agent (SA) Configuration → Graphics Configuration → DVMT Pre-Allocated"
Elkhart Lake Platform
* Set **PM Support** to **Enabled** in **Chipset** → **System Agent (SA) Configuration** → **Graphics Configuration** → **PM support**.
* Set **DVMT Pre-Allocated** to **64MB** in **Chipset** → **System Agent (SA) Configuration** → **Graphics Configuration** → **DVMT Pre-Allocated**.
Elkhart Lake platform
=====================
* set "DMVT Pre-Allocated" to "64MB" in "Intel Advanced Menu → System Agent(SA) Configuration → Graphics Configuration → DMVT Pre-Allocated"
Pass-through GPU to Guest
**************************
* Set **DMVT Pre-Allocated** to **64MB** in **Intel Advanced Menu** → **System Agent(SA) Configuration** → **Graphics Configuration** → **DMVT Pre-Allocated**.
Passthrough the GPU to Guest
****************************
1. Copy ``/usr/share/acrn/samples/nuc/launch_win.sh`` to ``install_win.sh``
@ -62,11 +66,11 @@ Pass-through GPU to Guest
cp /usr/share/acrn/samples/nuc/launch_win.sh ~/install_win.sh
2. Modify ``install_win.sh`` script to specify the Windows image you use.
#. Modify the ``install_win.sh`` script to specify the Windows image you use.
3. Modify ``install_win.sh`` script to enable GVT-d.
#. Modify the ``install_win.sh`` script to enable GVT-d.
Add the following commands before ``acrn-dm -A -m $mem_size -s 0:0,hostbridge \``
#. Add the following commands before ``acrn-dm -A -m $mem_size -s 0:0,hostbridge \``
::
@ -76,66 +80,53 @@ Add the following commands before ``acrn-dm -A -m $mem_size -s 0:0,hostbridge \`
echo "0000:00:02.0" > /sys/bus/pci/devices/0000:00:02.0/driver/unbind
echo "0000:00:02.0" > /sys/bus/pci/drivers/pci-stub/bind
Replace ``-s 2,pci-gvt -G "$2" \`` with ``-s 2,passthru,0/2/0,gpu \``
#. Replace ``-s 2,pci-gvt -G "$2" \`` with ``-s 2,passthru,0/2/0,gpu \``
4. Run the ``launch_win.sh``.
#. Run ``launch_win.sh``.
.. note:: If you want to pass-through GPU to Clear Linux User VM, the steps are
the same as above except your script.
.. note:: If you want to passthrough the GPU to a Clear Linux User VM, the
steps are the same as above except your script.
Enable GVT-d GOP driver
***********************
Enable the GVT-d GOP driver
***************************
Issue
======
When enabling GVT-d, guest OS couldnt light up physical screen
before OS driver load. So guest BIOS and
grub GUI couldnt be showed on the physical screen.
When enabling GVT-d, the Guest OS cannot light up the physical screen before
the OS driver loads. As a result, the Guest BIOS and the Grub UI is not visible on the physical screen. The occurs because the physical display is initialized by the GOP driver or VBIOS before the OS driver loads, and the Guest BIOS doesnt have them.
Reason
==========
Physical display is initialized by GOP driver or VBIOS
before OS driver load, but guest BIOS doesnt have them.
Solution
==========
Integrate GOP driver binary into OVMF as a Dxe driver,
then guest OVMF could see GOP driver and run it in
graphic pass-through environment.
So physical display could be initialized
by GOP and used by guest BIOS and guest grub.
The solution is to integrate the GOP driver binary into the OVMF as a DXE
driver. Then the Guest OVMF can see the GOP driver and run it in the graphic
passthrough environment. The physical display can be initialized
by the GOP and used by the Guest BIOS and Guest Grub.
Steps
======
1. fetch ACRN OVMF
=====
1. Fetch the ACRN OVMF:
::
git clone https://github.com/projectacrn/acrn-edk2.git
2. fetch vbt and gop driver
#. Fetch the vbt and gop drivers.
Fetch vbt and gop driver from the board manufacturer according to your CPU model name.
Fetch the **vbt** and **gop** drivers from the board manufacturer according to your CPU model name.
3. add vbt and gop driver into OVMF
#. Add the **vbt** and **gop** drivers to the OVMF:
::
cp IntelGopDriver.efi acrn-edk2/OvmfPkg/IntelGop/IntelGopDriver.efi
cp Vbt.bin acrn-edk2/OvmfPkg/Vbt/Vbt.bin
Notes:
Confirm that these binaries names match the board manufacturer names.
- Please confirm these binaries names with board manufacturer.
#. Git apply the following two patches:
4. git apply the following two patches
* `Use-the-default-vbt-released-with-GOP-driver.patch <../_static/downloads/Use-the-default-vbt-released-with-GOP-driver.patch>`_
* `Use-the-default-vbt-released-with-GOP-driver.patch
<../_static/downloads/Use-the-default-vbt-released-with-GOP-driver.patch>`_
* `Integrate-IntelGopDriver-into-OVMF.patch
<../_static/downloads/Integrate-IntelGopDriver-into-OVMF.patch>`_
* `Integrate-IntelGopDriver-into-OVMF.patch <../_static/downloads/Integrate-IntelGopDriver-into-OVMF.patch>`_
5. compile OVMF
#. Compile the OVMF:
::
@ -153,15 +144,15 @@ Notes:
build -DFD_SIZE_2MB -DDEBUG_ON_SERIAL_PORT=TRUE
Notes:
Keep in mind the following:
- You need a build machine that has a GCC 5.X version installed.
- Use a build machine that has GCC 5.X version installed.
- ``source edksetup.sh``, this step is needed for compilation every time
- The ``source edksetup.sh`` step is needed for compilation every time
a shell is created.
- This will generate the binary at
``Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd``, transfer the binary to
``Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd``. Transfer the binary to
your target machine.
- Modify the launch script to specify the OVMF you built just now.

View File

@ -3,11 +3,13 @@
Launch Windows as the Guest VM on ACRN
######################################
This tutorial describes how to launch Windows as a Guest (WaaG) VM on the
ACRN hypervisor.
Verified version
****************
* Clear Linux version: 33050
* ACRN-hypervisor tag: v1.6.1 (acrn-2020w18.4-140000p)
* ACRN-Kernel (Service VM kernel): 4.19.120-108.iot-lts2018-sos
@ -22,6 +24,7 @@ Verified version
Hardware setup
**************
The following Intel Kaby Lake NUCs are verified:
.. csv-table::
@ -32,40 +35,44 @@ The following Intel Kaby Lake NUCs are verified:
ACRN Service VM Setup
*********************
If necessary, refer to the steps in :ref:`kbl-nuc-sdc` to set up ACRN on the
KBL NUC. Once complete, you should be able to launch the Service VM
successfully.
Setup for Using Windows as the Guest VM
***************************************
All patches to support WaaG have been upstreamed; download them from the
``acrn-hypervisor repository``.
``acrn-hypervisor`` repository.
Build ACRN EFI Images
=====================
#. Follow the steps described at :ref:`getting-started-building` to set up the build environment.
#. Use the ``make`` command to compile the ``acrn.efi`` and ``acrn-dm``::
#. Use the ``make`` command to compile ``acrn.efi`` and ``acrn-dm``::
$ git clone https://github.com/projectacrn/acrn-hypervisor.git
$ cd acrn-hypervisor
$ make FIRMWARE=uefi BOARD=kbl-nuc-i7
#. Get the outputs from the following::
#. Get outputs from the following::
$ build/hypervisor/acrn.efi
$ build/devicemodel/acrn-dm
#. Replace the ``acrn.efi`` and ``acrn-dm`` on your NUC:
#. Replace ``acrn.efi`` and ``acrn-dm`` on your NUC:
a. Log in to the ACRN Service VM and then ``mount`` the EFI partition to ``/boot``
#. ``scp`` the ``acrn.efi`` and ``acrn-dm`` from your host::
#. ``scp`` both ``acrn.efi`` and ``acrn-dm`` from your host::
# scp <acrn.efi from your host> /boot/EFI/acrn/
# scp <acrn-dm from your host> /usr/bin/
# chmod +x /usr/bin/acrn-dm && sync
Build the Service VM Kernel
Build the Service VM kernel
===========================
#. Follow the steps described at :ref:`getting-started-building` to set up
the build environment.
#. Follow the steps below to build the ACRN kernel::
@ -78,8 +85,9 @@ Build the Service VM Kernel
$ make olddefconfig O=${WORKDIR}/build && make -j${JOBS} O=${WORKDIR}/build
$ make modules_install INSTALL_MOD_PATH=${WORKDIR}/build-rootfs O=${WORKDIR}/build -j${JOBS}
Update the Kernel on KBL NUC
============================
Update the KBL NUC kernel
=========================
#. Copy the new kernel image (bzImage) and its modules to the target machine::
# scp <your host>:$WORKDIR/build/arch/x86/boot/bzImage /boot/bzImage
@ -96,37 +104,43 @@ Update the Kernel on KBL NUC
.. note:: Change ``/dev/sda3`` to your file system partition.
#. ``reboot`` the Service VM and select ``The ACRNGT Service VM`` from the
#. Reboot the Service VM and select ``The ACRNGT Service VM`` from the
boot menu to apply the ACRN kernel and hypervisor updates.
Create Windows 10 Image in Service VM
=====================================
Create a Windows 10 image in the Service VM
===========================================
Create a Windows 10 image to install Windows 10 onto a virtual disk.
Download Win10 ISO and Drivers
Download Win10 ISO and drivers
------------------------------
#. Download `Windows 10 LTSC ISO <https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise>`_.
- Select **ISO-LTSC**, then click **Continue**.
- Complete the required info then click **Continue**.
- Select the language and **x86 64 bit**, then click **Download ISO** and save as ``windows10-LTSC-17763.iso``.
- Select **ISO-LTSC** and click **Continue**.
- Complete the required info. Click **Continue**.
- Select the language and **x86 64 bit**. Click **Download ISO** and save as ``windows10-LTSC-17763.iso``.
#. Download the `Intel DCH Graphics Driver <https://downloadmirror.intel.com/29074/a08/igfx_win10_100.7212.zip>`_.
#. Download the `Oracle Windows driver <https://edelivery.oracle.com/osdc/faces/SoftwareDelivery>`_.
- Sign in. If you do not have an Oracle account, register for one.
- Select **Download Package**. Key in **Oracle Linux 7.6** and click **Search**.
- Click **DLP: Oracle Linux 7.6**; it will be added to your Cart.
- Click **Checkout** which is located at the top right corner.
- Under **Platforms/Language**, select **x86 64 bit**, and click **Continue**.
- Check **I accept the terms in the license agreement**; click **Continue**.
- In the list, right check the item labeled **Oracle VirtIO Drivers Version for Microsoft Windows 1.x.x, yy MB**,
and then **Save link as ...**. Currently, it is named **V982789-01.zip**.
- Click **Download**. When the download is complete, unzip the file. You will see an ISO named **winvirtio.iso**.
- Select **Download Package**. Key in **Oracle Linux 7.6** and click
**Search**.
- Click **DLP: Oracle Linux 7.6** to add to your Cart.
- Click **Checkout** which is located at the top-right corner.
- Under **Platforms/Language**, select **x86 64 bit**. Click **Continue**.
- Check **I accept the terms in the license agreement**. Click **Continue**.
- From the list, right check the item labeled **Oracle VirtIO Drivers
Version for Microsoft Windows 1.x.x, yy MB**, and then **Save link as
...**. Currently, it is named **V982789-01.zip**.
- Click **Download**. When the download is complete, unzip the file. You
will see an ISO named **winvirtio.iso**.
Create a raw disk
-----------------
Create Raw Disk
---------------
Run these commands on the Service VM::
# swupd bundle-add kvm-host
@ -134,8 +148,8 @@ Run these commands on the Service VM::
# cd /root/img
# qemu-img create -f raw win10-ltsc.img 30G
Prepare Script to Create Image
-------------------------------
Prepare the script to create an image
-------------------------------------
#. Copy ``/usr/share/acrn/samples/nuc/launch_win.sh`` to ``install_win.sh``::
@ -144,29 +158,34 @@ Prepare Script to Create Image
#. Edit the ``acrn-dm`` command line in ``install_win.sh`` as follows:
.. note:: Make sure you use GVT-g ``-s 2,pci-gvt -G "$2"`` in acrn-dm
command line. Now we cannot support creating windows image by GVT-d.
.. note:: Make sure you use GVT-g ``-s 2,pci-gvt -G "$2"`` in the
``acrn-dm`` command line. Currently, we do not support creating a
windows image by GVT-d.
- Change ``-s 3,virtio-blk,./win10-ltsc.img`` to your path to the Windows 10 image.
- Change ``-s 3,virtio-blk,./win10-ltsc.img`` to your path to the Windows
10 image.
- Add ``-s 6,xhci,1-5:1-9``. You may need to change 1-5:1-9 to match the ports of
the USB keyboard/Mouse and flash on your platform.
- Add ``-s 6,xhci,1-5:1-9``. You may need to change 1-5:1-9 to match the
ports of the USB keyboard/mouse and flash on your platform.
- Add ``-s 8,ahci,cd:./windows10-LTSC-17763.iso`` to point to the Win10 ISO.
- Add ``-s 8,ahci,cd:./windows10-LTSC-17763.iso`` to point to the Win10
ISO.
- Add ``-s 9,ahci,cd:./winvirtio.iso`` to point to your path to the winvirtio iso.
- Add ``-s 9,ahci,cd:./winvirtio.iso`` to point to your path to the
winvirtio iso.
Install Windows 10 by GVT-g
---------------------------
.. note:: Make sure you have configured your monitor and display according to **3** of
:ref:`Boot Windows with GVT-g on ACRN <waag_display_conf_lable>`.
.. note:: Make sure you have configured your monitor and display according
to **3** of :ref:`Boot Windows with GVT-g on ACRN <waag_display_conf_lable>`.
#. Run ``install_win.sh``. When you see the UEFI shell, input **exit**.
#. Select **Boot Manager** and boot up from Win10 ISO.
#. When the display reads **Press any key to boot from CD or DVD** on the monitor,
press any key in the terminal on the **Host** side.
#. When the display reads **Press any key to boot from CD or DVD** on the
monitor, press any key in the terminal on the **Host** side.
.. figure:: images/windows_install_1.png
:align: center
@ -194,8 +213,8 @@ Install Windows 10 by GVT-g
- Virtio-block
- Virtio-input
.. note:: Be sure to unselect **Hide Drivers that aren't compatible with this computer's hardware**
near the bottom of the page.
.. note:: Be sure to unselect **Hide Drivers that aren't compatible with
this computer's hardware** near the bottom of the page.
.. figure:: images/windows_install_5.png
:align: center
@ -210,38 +229,40 @@ Install Windows 10 by GVT-g
.. figure:: images/windows_install_7.png
:align: center
#. The system will restart.
#. Verify that the system restarts.
.. figure:: images/windows_install_8.png
:align: center
#. Windows will restart several times and then you will be asked to configure your system.
#. Configure your system when Windows completes its restart cycle.
.. figure:: images/windows_install_9.png
:align: center
#. The Windows installation is completed after a few configuration steps; the Windows desktop displays.
#. Verify that the Windows desktop displays after the Windows installation is complete.
.. figure:: images/windows_install_10.png
:align: center
#. Copy `Intel DCH Graphics Driver <https://downloadmirror.intel.com/29074/a08/igfx_win10_100.7212.zip>`_ into
Windows and install in safe mode, the display driver is updated to 7212.
#. Copy the `Intel DCH Graphics Driver <https://downloadmirror.intel.com/29074/a08/igfx_win10_100.7212.zip>`_ into
Windows and install in safe mode. The display driver is updated to 7212.
.. _waag_display_conf_lable:
Boot Windows on ACRN with default configuration
===============================================
#. Modify the ``/usr/share/acrn/samples/nuc/launch_win.sh`` script to specify the Windows image generated above.
Boot Windows on ACRN with a default configuration
=================================================
#. Run the ``launch_win.sh``. The WaaG desktop displays on the HDMI monitor.
#. Modify the ``/usr/share/acrn/samples/nuc/launch_win.sh`` script to
specify the Windows image that is generated above.
.. note:: We support GVT-g and GVT-d while launching Windows guest.
If you use GVT-g, you can set up Weston in the Service VM, and set up Weston as the
desktop environment in the Service VM to experience Windows with the
AcrnGT local display feature. If you use GVT-d, please set 64MB for DVMT Pre-Allocated and
Enabled for PM Support in BIOS at first, then only Windows has display.
#. Run ``launch_win.sh``. The WaaG desktop displays on the HDMI monitor.
.. note::
We support GVT-g and GVT-d while launching Windows guest. If you use GVT-g, you can set up Weston in the Service VM, and set up
Weston as the desktop environment in the Service VM in order to
experience Windows with the AcrnGT local display feature. If you use
GVT-d, set **DVMT Pre-Allocated** to **64MB** and set **PM Support**
to **Enabled** in the BIOS. Then, only Windows displays.
ACRN Windows verified feature list
**********************************
@ -268,30 +289,32 @@ ACRN Windows verified feature list
, "Microsoft Store", "OK"
, "3D Viewer", "OK"
Known Limitations
Known limitations
*****************
* The cursor is not visible with the GVT-g local display.
Explanation for acrn-dm popular command lines
*********************************************
.. note:: You can use these acrn-dm command lines according to your real requirements.
.. note:: Use these acrn-dm command line entries according to your
real requirements.
* *-s 2,passthru,0/2/0,gpu*:
This is GVT-d, to passthrough VGA controller to Windows.
* **-s 2,passthru,0/2/0,gpu**:
This is GVT-d to passthrough the VGA controller to Windows.
You may need to change 0/2/0 to match the bdf of the VGA controller on your platform.
* *-s 3,ahci,hd:/root/img/win10.img*:
* **-s 3,ahci,hd:/root/img/win10.img**:
This is the hard disk onto which to install Windows 10.
Make sure that the slot ID 3 points to your win10 img path.
Make sure that the slot ID **3** points to your win10 img path.
* *-s 4,virtio-net,tap0*:
* **-s 4,virtio-net,tap0**:
This is for the network virtualization.
* *-s 5,fbuf,tcp=0.0.0.0:5900,w=800,h=600*:
This opens a port 5900 on the Service VM which can be connected to via vncviewer.
* **-s 5,fbuf,tcp=0.0.0.0:5900,w=800,h=600**:
This opens port 5900 on the Service VM which can be connected to via vncviewer.
* *-s 6,virtio-input,/dev/input/event4*:
* **-s 6,virtio-input,/dev/input/event4**:
This is to passthrough the mouse/keyboard to Windows via virtio.
Change ``event4`` accordingly. Use the following command to check
the event node on your Service VM::
@ -299,18 +322,19 @@ Explanation for acrn-dm popular command lines
<To get the input event of mouse>
# cat /proc/bus/input/devices | grep mouse
* *-s 7,ahci,cd:/root/img/Windows10.iso*:
* **-s 7,ahci,cd:/root/img/Windows10.iso**:
This is the IOS image used to install Windows 10. It appears as a cdrom
device. Make sure that the slot ID 7 points to your win10 ISO path.
device. Make sure that the slot ID **7** points to your win10 ISO path.
* *-s 8,ahci,cd:/root/img/winvirtio.iso*:
* **-s 8,ahci,cd:/root/img/winvirtio.iso**:
This is cdrom device to install the virtio Windows driver. Make sure it points to your VirtIO ISO path.
* *-s 9,passthru,0/14/0*:
This is to passthrough USB controller to Windows.
You may need to change 0/14/0 to match the bdf of the USB controller on your platform.
* **-s 9,passthru,0/14/0**:
This is to passthrough the USB controller to Windows.
You may need to change 0/14/0 to match the bdf of the USB controller on
your platform.
* *--ovmf /usr/share/acrn/bios/OVMF.fd*:
* **--ovmf /usr/share/acrn/bios/OVMF.fd**:
Make sure it points to your OVMF binary path.
Secure boot enabling
@ -320,10 +344,12 @@ secure boot enabling.
Activate Windows 10
********************
If you are using a trial version of Windows 10, you might find that some
If you use a trial version of Windows 10, you might find that some
apps and features do not work or that Windows 10 automatically gets shut
down by the Windows licensing monitoring service. To avoid these issues,
obtain a licensed version of Windows.
For Windows 10 activation steps, refer to
"`Activate Windows 10 <https://support.microsoft.com/en-us/help/12440/windows-10-activate>`__"
`Activate Windows 10 <https://support.microsoft.com/en-us/help/12440/windows-10-activate>`__.
.. comment Reviewed for grammatical content on 20 May 2020.