= Xen GPU Cluster = == 實作 一: 如何將Dom0上的顯示卡資源分配給DomU == == Hardware == ||Machine|| Dell !OptiPlex 755 ||Node|| 1 node ||CPU|| Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz ||Memory|| 6GB ||Storage|| 160GB ||Video Card|| NVIDIA !GeForce 9800GT 1GB == Software == ||OS!#1|| Ubuntu 8.10 with Kernel: 2.6.28 x86_64 (non-xen-patched kernel) ||OS!#2|| Ubuntu 8.10 with Kernel: 2.6.22-9 x86_64 (Xen-3.3.1+Lustre patched kernel) [[BR]] = Part 1 建構基本環境 = == 步驟一: 連線到遠端主機 == # 以下兩種連線方式擇一使用. [[BR]] rider@cloud:~$ ssh 140.xxx.xxx.xxx [[BR]] rider@cloud:~$ vncviewer 140.xxx.xxx.xxx [[BR]] == 步驟二: 產生一台虛擬機器來使用 CUDA == # 設定你想要怎樣規格的虛擬機器 rider@cloud:~$ sudo vim /etc/xen-tools/xen-tools.conf [[BR]] {{{ dir = /home install-method = debootstrap size = 8Gb # Disk image size. memory = 1024Mb # Memory size swap = 128Mb # Swap size fs = ext3 # use the EXT3 filesystem for the disk image. dist = hardy # Default distribution to install. ---> For CUDA Support (Ubuntu 8.0.4) image = sparse # Specify sparse vs. full disk images. gateway = 140.XXX.XXX.XXX netmask = 255.255.255.0 broadcast = 140.XXX.XXX.XXX kernel = /boot/vmlinuz-`uname -r` initrd = /boot/initrd.img-`uname -r` mirror = http://gb.archive.ubuntu.com/ubuntu/ ext3_options = noatime,nodiratime,errors=remount-ro ext2_options = noatime,nodiratime,errors=remount-ro xfs_options = defaults reiser_options = defaults }}} rider@cloud:~$ sudo xen-create-image --hostname nvidia --ip 140.XXX.XXX.XXX [[BR]] == 步驟三: 設定你的虛擬機器 == rider@cloud:~$ sudo vim /etc/xen/nvidia.cfg [[BR]] {{{ kernel = '/boot/vmlinuz-2.6.22.9' ramdisk = '/boot/initrd.img-2.6.22.9' memory = '1024' vcpus = '4' pci = ['01:00.0'] root = '/dev/sda2 ro' disk = [ 'file:/home/domains/nvidia/disk.img,sda2,w', 'file:/home/domains/nvidia/swap.img,sda1,w', ] name = 'nvidia' # # Networking # vif = [ 'ip=140.xxx.xxx.xxx,mac=00:16:3E:AA:70:5C' ] # # Behaviour # on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart' }}} == 步驟四: == == 步驟五: == == 步驟六: ==