| 1 | = Xen GPU Cluster = |
| 2 | == 實作 一: 如何將Dom0上的顯示卡資源分配給DomU == |
| 3 | |
| 4 | == Hardware == |
| 5 | ||Machine|| Dell !OptiPlex 755 |
| 6 | ||Node|| 1 node |
| 7 | ||CPU|| Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz |
| 8 | ||Memory|| 6GB |
| 9 | ||Storage|| 160GB |
| 10 | ||Video Card|| NVIDIA !GeForce 9800GT 1GB |
| 11 | |
| 12 | == Software == |
| 13 | ||OS!#1|| Ubuntu 8.10 with Kernel: 2.6.28 x86_64 (non-xen-patched kernel) |
| 14 | ||OS!#2|| Ubuntu 8.10 with Kernel: 2.6.22-9 x86_64 (Xen-3.3.1+Lustre patched kernel) |
| 15 | [[BR]] |
| 16 | |
| 17 | = Part 1 建構基本環境 = |
| 18 | |
| 19 | == 步驟一: 連線到遠端主機 == |
| 20 | # 以下兩種連線方式擇一使用. [[BR]] |
| 21 | rider@cloud:~$ ssh 140.xxx.xxx.xxx [[BR]] |
| 22 | rider@cloud:~$ vncviewer 140.xxx.xxx.xxx [[BR]] |
| 23 | |
| 24 | == 步驟二: 產生一台虛擬機器來使用 CUDA == |
| 25 | |
| 26 | # 設定你想要怎樣規格的虛擬機器 |
| 27 | rider@cloud:~$ sudo vim /etc/xen-tools/xen-tools.conf [[BR]] |
| 28 | {{{ |
| 29 | dir = /home |
| 30 | install-method = debootstrap |
| 31 | size = 8Gb # Disk image size. |
| 32 | memory = 1024Mb # Memory size |
| 33 | swap = 128Mb # Swap size |
| 34 | fs = ext3 # use the EXT3 filesystem for the disk image. |
| 35 | dist = hardy # Default distribution to install. ---> For CUDA Support (Ubuntu 8.0.4) |
| 36 | image = sparse # Specify sparse vs. full disk images. |
| 37 | gateway = 140.XXX.XXX.XXX |
| 38 | netmask = 255.255.255.0 |
| 39 | broadcast = 140.XXX.XXX.XXX |
| 40 | kernel = /boot/vmlinuz-`uname -r` |
| 41 | initrd = /boot/initrd.img-`uname -r` |
| 42 | mirror = http://gb.archive.ubuntu.com/ubuntu/ |
| 43 | ext3_options = noatime,nodiratime,errors=remount-ro |
| 44 | ext2_options = noatime,nodiratime,errors=remount-ro |
| 45 | xfs_options = defaults |
| 46 | reiser_options = defaults |
| 47 | }}} |
| 48 | rider@cloud:~$ sudo xen-create-image --hostname nvidia --ip 140.XXX.XXX.XXX [[BR]] |
| 49 | |
| 50 | == 步驟三: 設定你的虛擬機器 == |
| 51 | rider@cloud:~$ sudo vim /etc/xen/nvidia.cfg [[BR]] |
| 52 | {{{ |
| 53 | kernel = '/boot/vmlinuz-2.6.22.9' |
| 54 | ramdisk = '/boot/initrd.img-2.6.22.9' |
| 55 | |
| 56 | memory = '1024' |
| 57 | vcpus = '4' |
| 58 | pci = ['01:00.0'] |
| 59 | |
| 60 | root = '/dev/sda2 ro' |
| 61 | disk = [ |
| 62 | 'file:/home/domains/nvidia/disk.img,sda2,w', |
| 63 | 'file:/home/domains/nvidia/swap.img,sda1,w', |
| 64 | ] |
| 65 | name = 'nvidia' |
| 66 | |
| 67 | # |
| 68 | # Networking |
| 69 | # |
| 70 | vif = [ 'ip=140.xxx.xxx.xxx,mac=00:16:3E:AA:70:5C' ] |
| 71 | |
| 72 | # |
| 73 | # Behaviour |
| 74 | # |
| 75 | on_poweroff = 'destroy' |
| 76 | on_reboot = 'restart' |
| 77 | on_crash = 'restart' |
| 78 | }}} |
| 79 | |
| 80 | |
| 81 | == 步驟四: == |
| 82 | |
| 83 | == 步驟五: == |
| 84 | |
| 85 | == 步驟六: == |