- e-trees.Japan [e-trees.jp]
- Fast Handshake Join Implementation on FPGA with Adaptive Merging Network [acm.org]
- Hardware acceleration of Hadoop MapReduce [ieee.org]
- Tilera [tilera.com]
- Supporting Low-Latency CPS using GPUs and Direct I/O Schemes [ertl.jp]
- Data Transfer Matters for GPU Computing [ertl.jp]
- Relational Joins on Graphics Processors [acm.org]
- GPUDirect [nvidia.com]
- Roofline: an insightful visual performance model for multicore architectures [acm.org]
- Computer Organization and Design, 5th Edition [elsevier.com]
- Computer Architecture: A Quantitative Approach, 5th Edition [elsevier.com]
- The Datacenter as a Computer: An Introduction to the Design of Warehouse-Scale Machines, Second edition [morganclaypool.com]
March 11, 2014
"High Performance Data Processing by Advanced Hardware" in 76th National Convention of IPSJ
March 6, 2014
bootargs in .dts for Altera JTAG UART
Nios II Linux、Altera JTAG UART を使っている場合、sopc2dts で .sopcinfo から .dts を自動生成すると、bootargs に
sopc2dts の GUI 画面や、--board オプションで渡す boardinfo ファイルで bootargs の console=ttyAL0,... を console=ttyJ0,... に置き換えることで、early0 が閉じられた後もコンソールが表示される。
Linux の .config は make 3c120_defconfig のデフォルト値で構わなかった。
version: linux-socfpga 3.13 bb0bb0a
debug console=ttyAL0,115200
などと記載される。その場合でも make menuconfig で、Device Drivers -> Character devices -> Serial drivers -> Altera UART console support (CONFIG_SERIAL_ALTERA_UART_CONSOLE) を有効にすると、下記のように途中まではコンソールが表示される。しかし、その後ルートファイルシステムをマウントする辺りで boot console early0 が閉じられ、その後何も表示されなくなる。$ nios2-terminal Linux version 3.13.0-g434d565-dirty ... bootconsole [early0] enabled ... ... ... turn off boot console early0
sopc2dts の GUI 画面や、--board オプションで渡す boardinfo ファイルで bootargs の console=ttyAL0,... を console=ttyJ0,... に置き換えることで、early0 が閉じられた後もコンソールが表示される。
Linux の .config は make 3c120_defconfig のデフォルト値で構わなかった。
version: linux-socfpga 3.13 bb0bb0a
March 5, 2014
Linux kernel config for GPIO-less Nios II Qsys design
Nios II Linux、GPIO が無い Qsys デザインの場合、make menuconfig で Device Drivers -> GPIO Support を未選択にすると、Platform options -> Compile and link device tree into kernel image を有効にした場合でも、コンパイル時にエラーにならない。
version: linux-socfpga 3.13 bb0bb0a
version: linux-socfpga 3.13 bb0bb0a
March 4, 2014
Swap on RAM disk in CentOS 6.5 x86_64
RAM ディスク上にスワップを設定できるかの調査。
環境
swap file on ext4 @/tmp -> PASS
ちなみに、util-linux [wikipedia.org] によると、util-linux-ng は util-linux の後継として開発されたが、また util-linux という名前に戻ったらしい。
swap file on ramfs @/dev/ram0 -> FAIL
swap file on ext2 @/dev/ram0 -> PASS
swap partition @/dev/ram0 -> PASS
swap file on tmpfs -> FAIL
環境
$ uname -r 2.6.32-431.5.1.el6.x86_64 $ grep CONFIG_SWAP /usr/src/kernels/`uname -r`/.config CONFIG_SWAP=y $ grep CONFIG_BLK_DEV_RAM /usr/src/kernels/`uname -r`/.config CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=16384 $ cat /proc/swaps Filename Type Size Used Priority /dev/dm-1 partition 835576 0 -1
swap file on ext4 @/tmp -> PASS
$ mount (近頃(?) /tmp は RAM 扱いではない模様) $ dd if=/dev/zero of=/tmp/swapfile bs=1M count=1 $ mkswap -f /tmp/swapfile Setting up swapspace version 1, size = 1020 KiB no label, UUID=fd6633bd-5d5c-4e6a-99fc-f8ee9741eacc $ file /tmp/swapfile /tmp/swapfile: Linux/i386 swap file (new style) 1 (4K pages) size 255 pages $ chmod 600 /tmp/swapfile # swapon -v /tmp/swapfile swapon on /tmp/swapfile swapon: /tmp/swapfile: found swap signature: version 1, page-size 4, same byte order swapon: /tmp/swapfile: pagesize=4096, swapsize=1048576, devsize=1048576 # swapon -s Filename Type Size Used Priority /dev/dm-1 partition 835576 0 -1 /tmp/swapfile file 1016 0 -2 # swapoff /tmp/swapfileちなみに、swapon -v オプションを有効にしているとスワップファイルの permission が 600 でないと警告されたが、 600 であっても root 以外がオーナになら警告すべきだが警告されなかった。
$ swapon -V swapon: (util-linux-ng 2.17.2)stable/v2.17 の swapon.c は util-linux/util-linux.git [kernel.org] で uid を確認していないが、最新 stable/v2.24 の swapon.c util-linux/util-linux.git [kernel.org] では、uid もチェックしている模様。
ちなみに、util-linux [wikipedia.org] によると、util-linux-ng は util-linux の後継として開発されたが、また util-linux という名前に戻ったらしい。
swap file on ramfs @/dev/ram0 -> FAIL
# mkdir /mnt/ram0 # mount -t ramfs /dev/ram0 /mnt/ram0 # dd if=/dev/zero of=/mnt/ram0/swapfile bs=1M count=1 # mkswap -f /mnt/ram0/swapfile Setting up swapspace version 1, size = 1020 KiB no label, UUID=7a23a073-c7a0-4e13-abfb-a0746abe3afc mkswap: unable to relabel /mnt/ram0/swapfile to system_u:object_r:swapfile_t:s0: Operation not supported # file /mnt/ram0/swapfile /mnt/ram0/swapfile: Linux/i386 swap file (new style) 1 (4K pages) size 255 pages # chmod 600 /mnt/ram0/swapfile # swapon -v swapfile swapon on swapfile swapon: /mnt/ram0/swapfile: found swap signature: version 1, page-size 4, same byte order swapon: /mnt/ram0/swapfile: pagesize=4096, swapsize=1048576, devsize=1048576 swapon: swapfile: swapon failed: Invalid argument # dmesg | tail -1 swapon: swapfile has holes # cp /tmp/swapfile /mnt/ram0/ # chmod 600 /mnt/ram0/swapfile # swapon -v /mnt/ram0/swapfile swapon on /mnt/ram0/swapfile swapon: /mnt/ram0/swapfile: found swap signature: version 1, page-size 4, same byte order swapon: /mnt/ram0/swapfile: pagesize=4096, swapsize=1048576, devsize=1048576 swapon: /mnt/ram0/swapfile: swapon failed: Invalid argument # dmesg | tail -2 swapon: swapfile has holes swapon: swapfile has holes
swap file on ext2 @/dev/ram0 -> PASS
# mkfs /dev/ram0 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 4096 inodes, 16384 blocks 819 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=16777216 2 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193 Writing inode tables: done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 23 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. # mount -t ext2 /dev/ram0 /mnt/ram0 # dd if=/dev/zero of=/mnt/ram0/swapfile bs=1M count=1 # mkswap -f /mnt/ram0/swapfile Setting up swapspace version 1, size = 1020 KiB no label, UUID=acaff689-a570-43a7-8c97-2c8c80045bbc # chmod 600 /mnt/ram0/swapfile # swapon -v /mnt/ram0/swapfile swapon on /mnt/ram0/swapfile swapon: /mnt/ram0/swapfile: found swap signature: version 1, page-size 4, same byte order swapon: /mnt/ram0/swapfile: pagesize=4096, swapsize=1048576, devsize=1048576 # swapon -s Filename Type Size Used Priority /dev/dm-1 partition 835576 0 -1 /mnt/ram0/swapfile file 1004 0 -2 # dmesg | tail -1 Adding 1004k swap on /mnt/ram0/swapfile. Priority:-2 extents:5 across:1020k # swapoff /mnt/ram0/swapfile
swap partition @/dev/ram0 -> PASS
# mkswap /dev/ram0 Setting up swapspace version 1, size = 16380 KiB no label, UUID=efac3cf3-9d79-4f68-935c-f4da81845dbb # swapon -v /dev/ram0 swapon on /dev/ram0 swapon: /dev/ram0: found swap signature: version 1, page-size 4, same byte order swapon: /dev/ram0: pagesize=4096, swapsize=16777216, devsize=16777216 # swapon -s Filename Type Size Used Priority /dev/dm-1 partition 835576 0 -1 /dev/ram0 partition 16376 0 -2 # dmesg | tail -1 Adding 16376k swap on /dev/ram0. Priority:-2 extents:1 across:16376k # swapoff
swap file on tmpfs -> FAIL
# mkdir /mnt/tmp # mount -t tmpfs tmpfs /mnt/tmp # dd if=/dev/zero of=/mnt/tmp/tmpfsswap bs=1M count=1 # mkswap -f /mnt/tmp/tmpfsswap Setting up swapspace version 1, size = 1020 KiB no label, UUID=ed44d266-47e6-40a2-8ac7-7f925d88fa6e # chmod 600 /mnt/tmp/tmpfsswap # swapon -v /mnt/tmp/tmpfsswap swapon on /mnt/tmp/tmpfsswap swapon: /mnt/tmp/tmpfsswap: found swap signature: version 1, page-size 4, same byte order swapon: /mnt/tmp/tmpfsswap: pagesize=4096, swapsize=1048576, devsize=1048576 swapon: /mnt/tmp/tmpfsswap: swapon failed: Invalid argument # dmesg | tail (no message invoked by this swapon)tmpfs 自体 swap を使うのだから swap を tmpfs 上に作れるとは思えなかったが、念のためやってみた。
March 1, 2014
Linux for Nios II (MMU) on custom design
MMU を有効にした Nios II で Linux を動かす場合の最近の流儀はルートファイルシステムは uClinux [uclinux.org] でなく、BuildRoot [buildroot.net] に移行した模様。ビルド方法などの各種情報も Category:Linux - Altera Wiki [alterawiki.com] から Nios II Linux User Manual ・ Documentation ・ RocketBoards.org [rocketboards.org] に一本化されている。流行りは ARM 内蔵の Altera SoC [altera.com] に移ったのか、Nios II (MMU) + Linux で BuildRoot 移行後の情報はとても少ない(日本語では皆無?)。ちなみに、Altera SoC の場合は Yocto になる模様。Altera SoC Yocto Powered Embedded Linux [altera.com]
基本的に Nios II Linux User Manual ・ Documentation ・ RocketBoards.org [rocketboards.org] に従う。以下のセクションは上記文書に合わせる。
ホスト環境
- RedHat 5 x86_64
- Quartus II v13.1 (64bit)
1. Setting up toolchain
Sourcery CodeBench Lite Edition - Altera Nios II Processor - GNU/Linux release をダウンロード、インストール。
利用バージョン: Sourcery CodeBench Lite 2013.05-43
$ export PATH=/<your path>/CodeSourcery/Sourcery_CodeBench_Lite_for_Nios_II_GNU_Linux/bin/:$PATH $ export ARCH=nios2 $ export CROSS_COMPILE=nios2-linux-gnu-
2. Building root filesystem
git レポジトリでも良いが、Buildroot - Download [buildroot.net] より、リリース版をダウンロード、展開。
利用バージョン: buildroot-2013.11.tar.(bz2|gz)
$ wget http://www.rocketboards.org/pub/Documentation/NiosIILinuxUserManual/nios2_defconfig $ mv nios2_defconfig configs/ $ make nios2_defconfig $ make menuconfig $ make source (オフラインビルドをしたい場合) $ make
3. Building U-Boot
とりあえず U-Boot は使わず、JTAG (nios2-download) でカーネルとルートファイルシステムをメモリに展開するため、スキップ。
4. Building Nios II Linux kernel
sopc2dts [alterawiki.com] をインストールしておく。
レポジトリ: sopc-tools.git
ブランチは無いので、master の現時点での head をダウンロード、展開、make。
利用バーション: commit 83a62e0e3d8618afeb92bf15f2696fbd0804680a [rocketboards.org]
java がインストールされていなければ、インストールしておく。
# yum install java-1.7.0-oracle-devel
OpenJDK (CentOS 6) でもコンパイル、実行できた。
# yum install java-1.7.0-openjdk-devel
linux-socfpga.git [rocketboards.org] レポジトリの socfpga-3.13 [rocketboards.org] head のスナップショットをダウンロード、展開。
利用バージョン: commit: bb0bb0a2a05443edef7af9f7de9fc8c3f36f01cb [rocketboards.org]
$ make 3c120_defconfig $ java -jar ../sopc-tools-83a62e0/sopc2dts/sopc2dts.jar --board ../hoge.boardinfo --input ../hoge.sopcinfo --output arch/nios2/boot/dts/hoge.dts (.sopcinfo は Qsys で出力。.boardinfo は一度 sopc2dts --gui で起動し生成。) $ make menuconfig General setup -> Initial RAM filesystem and RAM disk (initramfs/initrd) support を有効化 General setup -> Initramfs source file(s). に "../buildroot/output/images/rootfs.cpio" など、buildroot で生成したルートファイルシステムの .cpio のパスを指定 Platform options -> Compile and link device tree into kernel image を有効化 Platform options -> Device tree source file. に "arch/nios2/boot/dts/hoge.dts" など上記 .dts のパスを指定 $ make zImage $ nios2-download -g vmlinux && nios2-terminal (nios2-download -g arch/nios2/boot/zImage の方が転送が速い)
Subscribe to:
Posts (Atom)