Skip to content

Commit

Permalink
Merge pull request #425 from sy-c/master
Browse files Browse the repository at this point in the history
v0.45.5
  • Loading branch information
sy-c authored Dec 19, 2024
2 parents 53c5c81 + 3fd3fdc commit 94c06b7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,14 @@ It may use files in these directories for DMA buffers:
The program will report the exact file used.
They can be inspected manually if needed, e.g. with hexdump: `hexdump -e '"%07_ax" " | " 4/8 "%08x " "\n"' [filename]`
Example usage:
```
for i in 0 1; do roc-config --i=#$i --clock=local --links=0-1 --tf=32 --byp --loop --dyn --force --datapathmode=streaming; done
roc-bench-dma --i=#0 --fast --data=FEE --bypass
o2-roc-ctp-emulator --id=#0 --trigger-mode=continuous --init-orbit=0x1e
```
### roc-cleanup
In the event of a serious crash, such as a segfault, it may be necessary to clean up and reset.
This tool serves this purpose and is intended to be run as root. Be aware that this will make every
Expand Down
3 changes: 3 additions & 0 deletions doc/releaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ This file describes the main feature changes for released versions of ReadoutCar

## v0.45.4 - 26/09/2024
- Updated list of firmwares.

## v0.45.5 - 19/12/2024
- Added internal fallback when hugeadm tool not available to setup hugepages (e.g.for RHEL9).
2 changes: 1 addition & 1 deletion src/ReadoutCardVersion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "ReadoutCard/Version.h"

#define O2_READOUTCARD_VERSION "0.45.3"
#define O2_READOUTCARD_VERSION "0.45.5"

namespace o2
{
Expand Down
33 changes: 31 additions & 2 deletions src/o2-roc-setup-hugetlbfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ HUGEPAGES_1G_SYSFILE=/sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
HUGEPAGES_1G_NUMBER=6


which hugeadm
if [ "$?" == "0" ]; then
FOUND_HUGEADM=1
else
echo "hugeadm command not found, using internal fallback"
fi

# Allocate hugepages of each type
echo -n "File '${HUGEPAGES_2M_CONF}' "
if [ -f $HUGEPAGES_2M_CONF ]; then
Expand All @@ -34,15 +41,37 @@ echo $HUGEPAGES_1G_NUMBER > $HUGEPAGES_1G_SYSFILE

# Create hugetlbfs mounts in /var/lib/hugetlbfs/global/...
echo "Creating hugetlbfs mounts"
hugeadm --create-global-mounts
if [ "$FOUND_HUGEADM" == "1" ]; then
hugeadm --create-global-mounts
else
for sz in 2M 1G; do
MPDIR=/var/lib/hugetlbfs/global/pagesize-${sz}B
mountpoint -q $MPDIR
if [ "$?" -ne 0 ]; then
echo "Mounting $MPDIR"
mount -t hugetlbfs -o pagesize=${sz} none $MPDIR
chown root:root $MPDIR
chmod 1777 $MPDIR
else
echo "Already mounted: $MPDIR"
fi
done
fi
echo "Setting permissions on hugeltbfs mounts"
chgrp -R pda /var/lib/hugetlbfs/global/*
chmod -R g+rwx /var/lib/hugetlbfs/global/*

# Display hugepage status
echo ""
echo "Hugepages:"
hugeadm --pool-list
if [ "$FOUND_HUGEADM" == "1" ]; then
hugeadm --pool-list
else
echo -n "Number of 2MB hugepages: "
cat $HUGEPAGES_2M_SYSFILE
echo -n "Number of 1GB hugepages: "
cat $HUGEPAGES_1G_SYSFILE
fi
echo ""
echo "Use 'echo [number] > /sys/kernel/mm/hugepages/hugepages-[size]/nr_hugepages' to allocate hugepages manually"
echo "Or set a number in the following conf files and run the script again:"
Expand Down

0 comments on commit 94c06b7

Please sign in to comment.