Miscellaneous Tips¶
Add the fsimcluster
column to your AWS management console¶
Once you’ve deployed a simulation once with the manager, the AWS management console will allow you to add a custom column that will allow you to see at-a-glance which FireSim run farm an instance belongs to.
To do so, click the gear in the top right of the AWS management console. From
there, you should see a checkbox for fsimcluster
. Enable it to see the column.
FPGA Dev AMI Remote Desktop Setup¶
To Remote Desktop into your manager instance, you must do the following:
curl https://s3.amazonaws.com/aws-fpga-developer-ami/1.4.0/Scripts/setup_gui.sh -o /home/centos/src/scripts/setup_gui.sh
sudo sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-CR.repo
/home/centos/src/scripts/setup_gui.sh
The former two commands are required due to AWS FPGA Dev AMI 1.3.5 incompatibilities. See
https://forums.aws.amazon.com/message.jspa?messageID=848073#848073
and
Experimental Support for SSHing into simulated nodes and accessing the internet from within simulations¶
This is assuming that you are simulating a 1-node networked cluster. These instructions will let you both ssh into the simulated node and access the outside internet from within the simulated node:
- Set your config files to simulate a 1-node networked cluster (
example_1config
) - Run
firesim launchrunfarm && firesim infrasetup
and wait for them to complete - cd to
firesim/target-design/switch/
- Go into the newest directory that is prefixed with
switch0-
- Edit the
switchconfig.h
file so that it looks like this:
// THIS FILE IS MACHINE GENERATED. SEE deploy/buildtools/switchmodelconfig.py
#ifdef NUMCLIENTSCONFIG
#define NUMPORTS 2
#endif
#ifdef PORTSETUPCONFIG
ports[0] = new ShmemPort(0);
ports[1] = new SSHPort(1);
#endif
#ifdef MACPORTSCONFIG
uint16_t mac2port[3] {1, 2, 0};
#endif
- Run
make
thencp switch switch0
- Run
scp switch0 YOUR_RUN_FARM_INSTANCE_IP:switch_slot_0/switch0
- On the RUN FARM INSTANCE, run:
sudo ip tuntap add mode tap dev tap0 user $USER
sudo ip link set tap0 up
sudo ip addr add 192.168.0.1/24 dev tap0
sudo ifconfig tap0 hw ether 8e:6b:35:04:00:00
sudo sysctl -w net.ipv6.conf.tap0.disable_ipv6=1
- Run
firesim runworkload
. Confirm that the node has booted to the login prompt in the fsim0 screen. - To ssh into the simulated machine, you will need to first ssh onto the Run Farm instance, then ssh into the IP address of the simulated node (192.168.0.2), username root, password firesim. You should also prefix with TERM=linux to get backspace to work correctly: So:
ssh YOUR_RUN_FARM_INSTANCE_IP
# from within the run farm instance:
TERM=linux ssh 192.168.0.2
11. To also be able to access the internet from within the simulation, run the following on the RUN FARM INSTANCE:
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -A FORWARD -i eth0 -o tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i tap0 -o eth0 -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- Then run the following in the simulation:
route add default gw 192.168.0.1 eth0
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
At this point, you will be able to access the outside internet, e.g. ping google.com
or wget google.com
.