1

I am trying to run gem5 in FS mode. It works fine. But If I switch to super user(using sudo su) and then try then I get below error-

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/test/gem5/src/python/m5/main.py", line 435, in main
    exec filecode in scope
  File "configs/example/fs.py", line 344, in <module>
    test_sys = build_test_system(np)
  File "configs/example/fs.py", line 99, in build_test_system
    options.ruby, cmdline=cmdline)
  File "/home/test/gem5/configs/common/FSConfig.py", line 637, in makeLinuxX86System
    makeX86System(mem_mode, numCPUs, mdesc, self, Ruby)
  File "/home/test/gem5/configs/common/FSConfig.py", line 562, in makeX86System
    disk0.childImage(mdesc.disk())
  File "/home/test/gem5/configs/common/Benchmarks.py", line 58, in disk
    return disk(self.diskname)
  File "/home/test/gem5/configs/common/SysPaths.py", line 58, in __call__
    raise IOError, "Can't find a path to system files."
IOError: Can't find a path to system files.

Any lead??

Ciro Santilli
  • 3,693
  • 1
  • 18
  • 44
Rashmi
  • 73
  • 5

1 Answers1

0

First, avoid running gem5 as with sudo/as root if you can, for the same reasons as any other programs.

I would guess that the command through sudo is not seeing the M5_PATH environment variable: How to keep environment variables when using sudo Can you ensure that the variable is visible to the executable?

Finally, as mentioned at Gem 5 IOError: Can't find a path to system files. Full System X86 simulation setup M5_PATH is not needed anymore, so I would really just never use it, and just explicitly point to the files gem5 needs with the command line options.

Ciro Santilli
  • 3,693
  • 1
  • 18
  • 44
  • 1
    Thanks Ciro Santilli. You are right. The M5_PATH env variable was not visible to the executable. Just set the path and it worked. Thank you so much :) – Rashmi Aug 23 '18 at 05:36
  • @Rashmi great! Don't forget to accept this answer as it was useful to you (green tick under the answer vote count). This marks the problem as solved, gives me 15 rep, and gives you 2 rep! :-) – Ciro Santilli Aug 23 '18 at 09:43