| 50 | | == 步驟三: 設定你的虛擬機器 == |
| | 49 | == 步驟三: 查看你的顯卡資訊 == |
| | 50 | rider@cloud:~$ lspci -vv |
| | 51 | {{{ |
| | 52 | 01:00.0 VGA compatible controller: nVidia Corporation GeForce 9800 GT (rev a2) |
| | 53 | Subsystem: ASUSTeK Computer Inc. Device 82a0 |
| | 54 | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- |
| | 55 | Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- |
| | 56 | Latency: 0 |
| | 57 | Interrupt: pin A routed to IRQ 16 |
| | 58 | Region 0: Memory at fd000000 (32-bit, non-prefetchable) [size=16M] |
| | 59 | Region 1: Memory at d0000000 (64-bit, prefetchable) [size=256M] |
| | 60 | Region 3: Memory at fa000000 (64-bit, non-prefetchable) [size=32M] |
| | 61 | Region 5: I/O ports at dc80 [size=128] |
| | 62 | [virtual] Expansion ROM at fea00000 [disabled] [size=128K] |
| | 63 | Capabilities: <access denied> |
| | 64 | Kernel driver in use: pciback |
| | 65 | Kernel modules: nvidia, nvidiafb |
| | 66 | }}} |
| | 67 | |
| | 68 | == 步驟四: PCI Frontend Configuration 設定你的 DomU == |
| 85 | | == 步驟六: == |
| | 114 | '''# Caution: Make sure that the device is not controlled by any driver: there should be no driver symlink for nvidia.''' [[BR]] |
| | 115 | {{{ |
| | 116 | PATH: /sys/bus/pci/devices/0000:01:00.0/ |
| | 117 | driver -> ../../../../bus/pci/drivers/nvidia ---> This symlink shouldn't exist. |
| | 118 | }}} |
| | 119 | |
| | 120 | == 步驟六: 硬體直接存取設定 == |
| | 121 | |
| | 122 | === Permissive Flag === |
| | 123 | |
| | 124 | rider@cloud:~$ sudo vim /etc/xen/xend-pci-permissive.sxp [[BR]] |
| | 125 | {{{ |
| | 126 | (unconstrained_dev_ids |
| | 127 | #('0123:4567:89AB:CDEF') |
| | 128 | ('0000:01:00.0') |
| | 129 | ) |
| | 130 | }}} |
| | 131 | |
| | 132 | === User-space Quirks === |
| | 133 | |
| | 134 | rider@cloud:~$ sudo vim /etc/xen/xend-pci-quirks.sxp [[BR]] |
| | 135 | {{{ |
| | 136 | (pci_ids |
| | 137 | # Entries are formated as follows: |
| | 138 | # <vendor>:<device>[:<subvendor>:<subdevice>] |
| | 139 | |
| | 140 | ('10de:0605' # NVIDIA 9800GT |
| | 141 | ) |
| | 142 | ) |
| | 143 | }}} |
| | 144 | |
| | 145 | == 步驟七: 啟動並登入你的虛擬機器 DomU == |
| | 146 | '''說明: 用 root 免密碼先登入,然後建立自己的帳號. 改用自己的帳號登入(亦可用 root 登入 , 不新建帳號 ):''' [[BR]] |
| | 147 | @ Dom0 [[BR]] |
| | 148 | rider@cloud:~$ sudo xm create -c nvidia.cfg [[BR]] |
| | 149 | |
| | 150 | @ DomU [[BR]] |
| | 151 | root@nvidia:~# adduser username [[BR]] |
| | 152 | root@nvidia:~# vim /etc/sudoers [[BR]] |
| | 153 | {{{ |
| | 154 | username ALL=(ALL) ALL |
| | 155 | }}} |
| | 156 | |
| | 157 | == 步驟八: 設定你的 DomU == |
| | 158 | '''# 設定 locales (系統語系)''' [[BR]] |
| | 159 | rider@nvidia:~$ sudo vim /etc/profile [[BR]] |
| | 160 | {{{ |
| | 161 | # Locale |
| | 162 | export LANGUAGE="en_US.UTF-8" |
| | 163 | export LC_ALL="en_US.UTF-8" |
| | 164 | export LANG="en_US.UTF-8" |
| | 165 | }}} |
| | 166 | rider@nvidia:~$ source /etc/profile [[BR]] |
| | 167 | rider@nvidia:~$ sudo dpkg-reconfigure locales [[BR]] |
| | 168 | rider@nvidia:~$ sudo apt-get update [[BR]] |
| | 169 | rider@nvidia:~$ sudo apt-get install wget [[BR]] |
| | 170 | '''# 更新 PCI ID Database''' [[BR]] |
| | 171 | rider@nvidia:~$ sudo update-pciids [[BR]] |
| | 172 | '''# 查看顯卡資訊有無正常顯示''' [[BR]] |
| | 173 | rider@nvidia:~$ lspci [[BR]] |
| | 174 | {{{ |
| | 175 | 00:00.0 VGA compatible controller: nVidia Corporation GeForce 9800 GT (rev a2) |
| | 176 | }}} |
| | 177 | '''# 查看顯卡資源有無順利分配到 DomU''' [[BR]] |
| | 178 | rider@nvidia:~$ dmesg | grep pci |
| | 179 | {{{ |
| | 180 | pcifront pci-0: Installing PCI frontend |
| | 181 | pcifront pci-0: Creating PCI Frontend Bus 0000:00 |
| | 182 | pciback 0000:00:00.0: probing... |
| | 183 | pciback: pcistub_init_devices_late |
| | 184 | }}} |