Some problems with installing a p4 environment on a physical machine

I use the bin/install-p4dev-v6.sh script in that git to install the p4 environment, and when I get to the p4c part of the installation, the device always gets stuck in this position and appears to die.


I should be able to guarantee that it’s not the device, as I installed the p4 environment on the same device about 6 months ago

How much RAM does this system have? 2 GB is definitely minimum required. 4 GB recommended.

How much free disk space is available before you started the install-p4dev-v6.sh script? I believe 13 GBytes is the minimum recommended, more is fine.

What operating system were you running it on? The script itself checks that it is one of the supported ones: Ubuntu 18.04, 20.04, or 22.04, so probably it is one of those unless you have disabled that check.

My device has 32GB of RAM and 2000GB of storage and it doesn’t take up too much. I tried to compile and install it with the p4c source code I downloaded six months ago and it installed successfully. So I’m wondering if there could be some missing dependency or something wrong.

I tested this script yesterday on three VMs, all with 2 GB of RAM and 40 GB of free disk space, one Ubuntu 18.04, one Ubuntu 20.04, one Ubuntu 22.04, and on none of them did it get stuck at any point as you are observing.

I do not have any good guesses what the difference might be leading to the getting-stuck that you are experiencing but I am not.

If you ran the script saving the output in a file, e.g. something like this:

~/p4-guide/bin/install-p4dev-v6.sh |& tee log.txt

then we could compare the output you saw with the output that I get, on the same version of the OS (since the output from different OS versions varies quite a bit). Here are the output files I saved from yesterday’s runs I did:

One more suggestion: If you can open a separate terminal window while the one running install-p4dev-v6.sh is going, see if a command like top shows any significant CPU activity for any processes when it “hangs”. If there is some one or a few processes that look like they are using significant CPU time, what does the TIME column show? Is a single process running for over 10 minutes? (I have never seen that happen myself, but individual compilation commands can take a minute or two in some cases).

Look at their process ID and use ps axguwww | grep <pid_value> to see what its full command line options are.

That won’t necessarily lead directly to a solution to the issues you are facing, but it is more clues to go on.

I logged the log.txt file, which I tried to find today as he may have been overwritten by the last sequential installation

I have used the top command to view the process during execution. When compiling the source code of p4cd, multiple compiler processes appear and when the compilation reaches 54% progress, which is this step.

the system gets completely stuck and I can’t even move my mouse and the keyboard commands don’t work.

Curiouser and curiouser. I haven’t seen that before. Are you able to reboot the machine, and have a partial log file up to that point sitting on disk that you could send to me for comparison with one of my log files for the same OS version?

I find it especially odd that you see “multiple compiler processes appear” during compilation of p4c. I usually only see 1 at a time while compiling p4c, because of these two line in the install-p4dev-v6.sh script:

Did you change this in your copy of the script?

If you did not, then I don’t understand why your system would be trying to run multiple compilation processes at the same time while compiling p4c.

If you did change it, then I would recommend changing it back to a value of 1 and trying again. If you make the value too large, p4c has compilation processes that consume quite a lot of memory all by themselves, and if. you run too many in parallel your OS will run out of RAM, start swapping, and probably appear to come to a standstill, and/or fail compilation processes.

I didn’t find the log file from when the problem occurred, it had been overwritten. But I did find a similar log, except instead of a crash, the process was killed.
The crash usually occurs at line 467. Using the top command to view the processes will reveal multiple cc1plus processes and the cpu is basically at full load, after which the device will crash.
log.txt

I have not modified the script, the MAX_PARALLEL_JOBSr value is still 1. I have commented out the modules I have installed in parts due to network problems in China and the difficulty of downloading files from github.
For example, if I have already installed protobuf, but the grpc download fails due to network problems, I comment out the command that installs the protobuf part

If MAX_PARALLEL_JOBS is still 1, it confuses me greatly why you would see multiple parallel compilation processes occuring while compiling p4c. I see only 1 at a time. It isn’t quick, but it does work with less memory and at least for me, repeatably.

Sorry, I’m running out of ideas for what to try, other than to maybe consider starting over with a VM that is Ubuntu 20.04 without any modifications, in case any of the partially working steps you have done have left software packages installed in some partial or unusual state that my script cannot handle.

Thank you very much for your help, you have been very helpful. The installation has now been largely successful, by way of an early download of the source code. I am doing the installation on a physical device, which has other things in it, and therefore cannot reinstall the system.

nice pink monitor is all i see so i assume in in <3 with u already… i dunno it works out of the box here and linerate up to 12tbps in a pizzabox and they’re soldering the 24tbps version for a year or two… and the asic, well almost that big as a raspberry pi and does not needs a way more power to do that full capacity soooo imho you’re right, you had not tried this enough hard yet… take a coffe break and try copy-pasteing this all to google… sorry, we dont have a crystal ball at all nor cannot solve puzzles… :))))

show us a full log of what u did, the p4 code and so on… even better a full mininet lab that fails and a tldr that why its bad and so…

edit… mac addresses cannot run p4, yet… recall it’s only 6 bytes and a good half a hour movie needs at least 512 bytes of boot sector…:))))))))))))))))))

hi @andyfingerhut I installed the P4 environment from your script from githugb, I installed the sitxh version. I wanted to ask you a question, is it possible to run a simple mininet topology with a p4 switch instead without running or creating any p4 file or json file ? so I simply want to run an integrated mininet topology with a p4 switch(simple_switch, psaswitch …) and play with the cli etc ?