Changes between Initial Version and Version 1 of Reading/XenG/vmgl


Ignore:
Timestamp:
Apr 17, 2009, 2:32:30 PM (16 years ago)
Author:
rider
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Reading/XenG/vmgl

    v1 v1  
     1= Xen GPU Cluster Practice =
     2== 實作三: 在虛擬機器上獲得 GPU 硬體加速 - 使用VMGL ==
     3
     4== 步驟一: 在 Dom0 上安裝 VMGL ==
     5'''# 安裝環境所需套件.''' [[BR]]
     6rider@cloud:~/vmgl$ sudo apt-get install build-essential mesa-common-dev libglu1-mesa-dev mesa-utils libxmu-headers libxmu6 libxmu-dev zlib1g-dev libjpeg62 libjpeg62-dev xutils-dev libxaw-headers libxaw7 libxaw7-dev libxext6 libxext-dev rxvt lwm xauth xvfb xfonts-100dpi xfonts-75dpi culmus xfonts-scalable xfonts-base [[BR]]
     7'''# 下載VMGL.''' [[BR]]
     8rider@cloud:~/vmgl$ wget http://www.cs.toronto.edu/~andreslc/software/vmgl-0.1.tar.bz2 [[BR]]
     9rider@cloud:~/vmgl$ tar jxvf vmgl-0.1.tar.bz2 [[BR]]
     10rider@cloud:~/vmgl$ cd ./vmgl.hg/tightvnc/ [[BR]]
     11'''# Patch for AMD64_Machine.''' [[BR]]
     12rider@cloud:~/vmgl/vmgl.hg/tightvnc$ patch -p0 < ../../tightvnc-1.2.9-amd64support.patch [[BR]]
     13rider@cloud:~/vmgl$ cd .. [[BR]]
     14'''# 設定編譯器路徑.''' [[BR]]
     15rider@cloud:~/vmgl$ sudo ln -sf /usr/bin/make /usr/bin/gmake (if necessary) [[BR]]
     16'''# 編譯.''' [[BR]]
     17rider@cloud:~/vmgl/vmgl.hg$ make -j 4 [[BR]]
     18'''# 安裝於 Dom0(host) 端上.''' [[BR]]
     19rider@cloud:~/vmgl/vmgl.hg$ sudo make install-host [[BR]]
     20'''# 設定主機信任清單.''' [[BR]]
     21rider@cloud:~$ xauth [[BR]]
     22{{{
     23# Set the authority for remote guest.
     24
     25Using authority file /home/rider/.Xauthority
     26xauth> add guest/unix:10  MIT-MAGIC-COOKIE-1  ec0ffd387888b9749d55f88031505888
     27xauth> add guest/unix:1  MIT-MAGIC-COOKIE-1  6824789b4ce0ac5743aeb57fd3ef8f5b
     28xauth> exit
     29}}}
     30
     31== 步驟二: 建構一台 VMGL Guest VM ==
     32'''# 設定你想要怎樣規格的虛擬機器.'''
     33rider@cloud:~$ sudo vim /etc/xen-tools/xen-tools.conf [[BR]]
     34{{{
     35dir = /home
     36install-method = debootstrap
     37size   = 8Gb      # Disk image size.
     38memory = 1024Mb    # Memory size
     39swap   = 128Mb    # Swap size
     40fs     = ext3     # use the EXT3 filesystem for the disk image.
     41dist   = hardy    # Default distribution to install. ---> For CUDA Support (Ubuntu 8.0.4)
     42image  = sparse   # Specify sparse vs. full disk images.
     43gateway   = 140.XXX.XXX.XXX
     44netmask   = 255.255.255.0
     45broadcast = 140.XXX.XXX.XXX
     46kernel      = /boot/vmlinuz-`uname -r`
     47initrd      = /boot/initrd.img-`uname -r`
     48mirror = http://gb.archive.ubuntu.com/ubuntu/
     49ext3_options   = noatime,nodiratime,errors=remount-ro
     50ext2_options   = noatime,nodiratime,errors=remount-ro
     51xfs_options    = defaults
     52reiser_options = defaults
     53}}}
     54rider@cloud:~$ sudo xen-create-image --hostname guest --ip 140.XXX.XXX.XXX [[BR]]
     55
     56== 步驟三: 設定虛擬機器(Guest) ==
     57rider@cloud:~$ sudo vim /etc/xen/nvidia.cfg [[BR]]
     58{{{
     59kernel      = '/boot/vmlinuz-2.6.22.9'
     60ramdisk     = '/boot/initrd.img-2.6.22.9'
     61 
     62memory      = '1024'
     63vcpus       = '4'
     64
     65# 不需配置 PCIE 顯示卡
     66# pci         = ['01:00.0']
     67
     68root        = '/dev/sda2 ro'
     69disk        = [
     70                  'file:/home/domains/nvidia/disk.img,sda2,w',
     71                  'file:/home/domains/nvidia/swap.img,sda1,w',
     72              ]
     73name        = 'nvidia'
     74 
     75#
     76#  Networking
     77#
     78vif         = [ 'ip=140.xxx.xxx.xxx,mac=00:16:3E:AA:70:5C' ]
     79 
     80#
     81#  Behaviour
     82#
     83on_poweroff = 'destroy'
     84on_reboot   = 'restart'
     85on_crash    = 'restart'
     86}}}
     87
     88== 步驟四: 在 DomU(Guest) 上安裝 VMGL ==
     89'''# 啟動虛擬機器Guest並登入.''' [[BR]]
     90'''# 方法一.''' [[BR]]
     91rider@cloud:~$ sudo xm create -c guest.cfg [[BR]]
     92'''# 方法二.''' [[BR]]
     93@Dom0
     94rider@cloud:~$ sudo xm create guest.cfg [[BR]]
     95@!UserSide
     96rider@PC:~$ ssh 140.xxx.xxx.xxx [[BR]]
     97'''# 安裝環境所需套件.''' [[BR]]
     98rider@guest:~$ mkdir -p vmgl [[BR]]
     99rider@guest:~$ cd ./vmgl [[BR]]
     100rider@guest:~/vmgl$ sudo apt-get install build-essential mesa-common-dev libglu1-mesa-dev mesa-utils libxmu-headers libxmu6 libxmu-dev zlib1g-dev libjpeg62 libjpeg62-dev xutils-dev libxaw-headers libxaw7 libxaw7-dev libxext6 libxext-dev rxvt lwm xauth xvfb xfonts-100dpi xfonts-75dpi culmus xfonts-scalable xfonts-base [[BR]]
     101'''# 基本桌面環境.''' [[BR]]
     102{{{
     103# Desgin for lightweight basic windows support
     104
     105xfonts-base xfonts-100dpi xfonts-75dpi -> fonts support
     106rxvt -> x-terminal-emulator for VNC
     107lwm  -> x-window-manager for VNC
     108}}}
     109'''# 下載VMGL.''' [[BR]]
     110rider@guest:~/vmgl$ wget http://www.cs.toronto.edu/~andreslc/software/vmgl-0.1.tar.bz2 [[BR]]
     111rider@guest:~/vmgl$ tar jxvf vmgl-0.1.tar.bz2 [[BR]]
     112rider@guest:~/vmgl$ cd ./vmgl.hg/tightvnc/ [[BR]]
     113'''# Patch for AMD64_Machine.''' [[BR]]
     114rider@guest:~/vmgl/vmgl.hg/tightvnc$ patch -p0 < ../../tightvnc-1.2.9-amd64support.patch [[BR]]
     115rider@guest:~/vmgl$ cd .. [[BR]]
     116'''# 設定編譯器路徑.''' [[BR]]
     117rider@guest:~/vmgl$ sudo ln -sf /usr/bin/make /usr/bin/gmake (if necessary) [[BR]]
     118'''# 建立安裝所需基本目錄.''' [[BR]]
     119rider@guest:~/vmgl/vmgl.hg$ sudo mkdir -p /usr/lib/xorg (if necessary) [[BR]]
     120rider@guest:~/vmgl/vmgl.hg$ sudo mkdir -p /usr/lib/xorg/modules (if necessary) [[BR]]
     121rider@guest:~/vmgl/vmgl.hg$ sudo mkdir -p /usr/lib/xorg/modules/extensions (if necessary) [[BR]]
     122'''# 編譯.''' [[BR]]
     123rider@guest:~/vmgl/vmgl.hg$ make [[BR]]
     124'''# 安裝於 DomU(guest) 端上.''' [[BR]]
     125rider@guest:~/vmgl/vmgl.hg$ sudo make install-guest [[BR]]
     126'''# 修正 rgb PATH 問題.''' [[BR]]
     127{{{
     128## Fix the rgb_Path problem.
     129rider@guest:~/vmgl/vmgl.hg$ sudo mkdir -p /usr/X11R6/lib
     130rider@guest:~/vmgl/vmgl.hg$ sudo mkdir /usr/X11R6/lib/X11
     131rider@guest:~/vmgl/vmgl.hg$ sudo ln -sf /etc/X11/rgb.txt /usr/X11R6/lib/X11/rgb
     132}}}