gem5-gpu全系統模式


# 注意:安裝好gem5-gpu后再配置全系統環境

# 下載全系統模擬需要的工具,詳見http://gem5.org/Running_gem5#Full_System_.28FS.29_Mode,將Linux image放在binaries目錄,disk image放在disks目錄
# 跳過此步,因為下面倆個鏈接提供的Full System Files舊,會出現kernel too old、NR_CPUS limit 1 reached 錯誤信息: 
http://www.m5sim.org/dist/current/x86/x86-system.tar.bz2
# Config files : 
http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2

# 較新的Linux kernel image和disk(parsec):
http://www.cs.utexas.edu/~parsec_m5/x86_64-vmlinux-2.6.28.4-smp
http://www.cs.utexas.edu/~parsec_m5/x86root-parsec.img.bz2

# 目錄結構為:
# -x86-system
#   -binaries
#   -configs
#   -disks
# 修改gem-gpu/gem5/configs/common/SysPath.py,修改存放disk和image的目錄: path = [ '/dist/m5/system', '~/x86-system' ] # 修改gem5-gpu/gem5/configs/common/Benchmarks.py,X86對應的代碼: return env.get('LINUX_IMAGE', disk('x86root-parsec.img')) # 修改gem5-gpu/gem5/configs/common/FSConfig.py中的makeLinuxX86System方法 self.kernel = binary('x86_64-vmlinux-2.6.28.4-smp') # 下載linux-bigswap2.img ,放在x86-system/disks中 http://www.m5sim.org/dist/current/m5_system_2.0b3.tar.bz2 # 修改gem5/src/arch/X86/cpuid.cc,解決kernel bug、kernel panic問題,將后面的兩個參數改成 0xe7dbfbff, 0x00000209); # kernel BUG at arch/x86/kernel/xsave.c:323! # Kernel panic - not syncing: Attempted to kill the idle task! # Ref:https://groups.google.com/d/msg/gem5-gpu-dev/2ATuMoTPRTE/JJihLqzPCwAJ result = CpuidResult(0x00020f51, 0x00000805,0xe7dbfbff, 0x04000209);
# 注釋gem5-gpu/gem5-gpu/configs/fs_fusion.py中的m5.disableAllListeners(),啟動監聽端口

# 此項改動可選 # 修改gem5
/src/mem/packet_queue.cc,解決Packet queue %s has grown beyond 100 packets if (transmitList.size() > 1000)
# 編譯gem5-gpu,如果僅修改了Python腳本,則無需重新編譯;重新編譯時,有時會出現build目錄下缺少文件,將build目錄下的文件刪除后再編譯! # WORKDIR gem5-gpu/gem5 cd gem5 scons -j 3 build/X86_VI_hammer_GPU/gem5.opt --default=X86 EXTRAS=../gem5-gpu/src:../gpgpu-sim/ PROTOCOL=VI_hammer GPGPU_SIM=True # 此步可選,編輯gem5-gpu/configs/fs_fusion.py,注釋m5.disableAllListeners(),在Instantiate system前設置CPU核心數,設4 options.num_cpus = 4 # 運行模擬器,未指定 workload,啟動虛擬Linux后,進入bash shell build/X86_VI_hammer_GPU/gem5.opt ../gem5-gpu/configs/fs_fusion.py # 打開另一個終端, 連接至虛擬終端,在終端中執行bash命令、運行benchmark。詳見http://gem5.org/Running_gem5#Full_System_.28FS.29_Mode telnet localhost 3456
# 若要啟動全系統模式完成后立即執行特定workload,需要啟動gem5時使用“--script”選項
# 設rcS腳本為 backprop.rcS,內容為:
cd /rodinia/backprop
/sbin/m5 resetstats
./backprop_fusion [options?]
/sbin/m5 exit

# 要執行backprop_fusion,需要將可執行文件復制到disk中,路徑如rcS文件中的一樣
# 掛載鏡像到/mnt目錄,offset=起點 X sectorSize
sudo mount -o loop,offset=32256 x86root-parsec.img /mnt
# 復制benchmark到鏡像中,並卸載鏡像 sudo cp -r rodinia/backprop /mnt sudo umount /mnt

# 運行backprop.rcS
build/X86_VI_hammer_GPU/gem5.opt gem5-gpu_home/gem5-gpu/configs/fs_fusion.py --script=/path/to/your/rcS_File/backprop.rcS

# ——____———完———————————___—————__————————====———完_______________------______________=___________________--_完___-----
 
         

 




# 小插曲。
#運行某些程序時會出現DEADLOCK,可以修改deadlock_threshold,需要注意的是gem5-gpu/configs/gpu_protocol目錄和gpgpu-sim/gpgpu-sim/gpu-sim.cc
# 查看磁盤鏡像信息; fdisk
-lu x86root-parsec.img # ls /mnt可以查看到鏡像中的文件 # df -h查看磁盤鏡像的可用容量,如果不夠放benchmark,則需要擴充容量 http://zebinj.blog.163.com/blog/static/206290199201412114912137 http://www.somethingsomewhere.net/resize2fs-bad-magic-number-in-super-block

  # rcS cd命令無法進入benchmark所在目錄。可能需要將benchmark復制到鏡像后,再改變鏡像中目錄的權限(a+wr),即可進入。 

# 令我費解的是:將全新的鏡像放入disk目錄,rcS中的ls命令居然有chai-cuda-u-sim目錄removing ptxinfo 很慢~~~?

# 運行chai-cuda-u-sim,serial8250: too much work for irq4

# Ref:https://groups.google.com/d/msg/gem5-gpu-dev/CSEH38SXKh8/_EGIaDw8COwJ

Pass the command line parameter --access-host-pagetable (or something like that).

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM