-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::out_of_range exception #1
Comments
Hi @lalten , It could be caused by different output of tegrastats, maybe the output format changed. Unfortunately, I don't have access to TX2 anymore, so I can't debug it. Cheers Martin |
Hi @lalten, As @martinkersner said, it looks like the format has be changed. |
Thanks for the suggestion @Survial53. Unfortunately, I get the same error. My diff is
The output of
|
You may have to increase STATS_BUFFER_SIZE in file gtop.hh, for example: On TX2 with R28.2.0, the right indexes for cpu info and gpu info are 5 and 9. Note however that enabling swap would change these. |
Hi Martin, root@tegra-ubuntu:~/gstop/gtop-master# make then when I execute the sudo ./gtop. I am getting the following error. But still nothing works! This is the output I get from the ~/tegrastats RAM 748/3854MB (lfb 676x4MB) SWAP 0/0MB (cached 0MB) cpu [14%,43%,11%,12%]@1912 EMC 24%@1600 AVP 82%@13 VDE 0 GR3D 52%@998 EDP limit 1912 Could you please help me fix this problem. Thanks! |
Added support for TX1 R28.1. |
Hi HoneyPatouceul, Thanks a lot! I will test the code, when I have access to the machine in the morning. Thanks! |
Hi Honeypatouceul, I have tried your gtop.cc.txt but still it does not work. [sudo] password for ubuntu: Could you please help me to fix this issue. Thanks ! |
I have added support for R28.1, but you're running a very old R23.1 version.
Not sure about the GPU index (11), you should check and may let us know. |
Its working for 23.1
The GPU index is same as the R28.1, that is (7) Thanks! |
Hi, I modified Added new indexes for static const std::map<std::string, int> TX1cpuIdxMap = {
std::make_pair ("28-1.0", 5),
std::make_pair ("28-2.0", 8)
};
static const std::map<std::string, int> TX1gpuIdxMap = {
std::make_pair ("28-1.0", 7),
std::make_pair ("28-2.0", 12)
}; I do not have a TX2 to check, but the format of tegrastats' output should be the same, at least for CPU and GR3D_FREQ metrics. Therefore I just modified void get_cpu_stats_tx1(tegrastats & ts, const std::string & str) {
return get_cpu_stats_tx2(ts, str);
} It works now on my TX1. Hope it helps! Pietro |
Below the patch: --- gtop.cc 2018-11-07 20:47:56.483822500 +0100
+++ gtop.cc.txt 2018-02-19 17:36:47.000000000 +0100
@@ -8,7 +8,6 @@
std::mutex m;
std::condition_variable cv;
tegrastats t_stats;
-char l4t_version[8];
bool processed = false;
bool ready = false;
@@ -21,12 +20,10 @@
static const std::map<std::string, int> TK1gpuIdxMap = {
};
static const std::map<std::string, int> TX1cpuIdxMap = {
- std::make_pair ("28-1.0", 5),
- std::make_pair ("28-2.0", 8)
+ std::make_pair ("28-1.0", 5)
};
static const std::map<std::string, int> TX1gpuIdxMap = {
- std::make_pair ("28-1.0", 7),
- std::make_pair ("28-2.0", 12)
+ std::make_pair ("28-1.0", 7)
};
static const std::map<std::string, int> TX2cpuIdxMap = {
std::make_pair ("28-2.0", 5)
@@ -82,6 +79,7 @@
}
fclose(fid);
+ char l4t_version[8];
l4t_version[0] = l4tStr[3];
l4t_version[1] = l4tStr[4];
l4t_version[2] = '-';
@@ -269,20 +267,16 @@
}
void get_cpu_stats_tx1(tegrastats & ts, const std::string & str) {
- if (strcmp(l4t_version, "28-2.0")>=0)
- return get_cpu_stats_tx2(ts, str);
- else {
- auto cpu_stats = tokenize(str, '@');
- auto cpu_usage_all = cpu_stats.at(0);
- ts.cpu_freq.push_back(std::stoi(cpu_stats.at(1)));
- auto cpu_usage = tokenize(cpu_usage_all.substr(1, cpu_usage_all.size()-2), ',');
-
- for (const auto & u: cpu_usage) {
- if (u != "off")
- ts.cpu_usage.push_back(std::stoi(u.substr(0, u.size()-1)));
- else
- ts.cpu_usage.push_back(0);
- }
+ auto cpu_stats = tokenize(str, '@');
+ auto cpu_usage_all = cpu_stats.at(0);
+ ts.cpu_freq.push_back(std::stoi(cpu_stats.at(1)));
+ auto cpu_usage = tokenize(cpu_usage_all.substr(1, cpu_usage_all.size()-2), ',');
+
+ for (const auto & u: cpu_usage) {
+ if (u != "off")
+ ts.cpu_usage.push_back(std::stoi(u.substr(0, u.size()-1)));
+ else
+ ts.cpu_usage.push_back(0);
}
}
|
Thanks for your correction. But it is not work on my Jetson Nano. Thanks in advance. |
Same error. |
I built the code with
$ g++ -std=c++14 gtop.cc utils.cc display.cc -o gtop -pedantic -Wall -Wextra -lncurses -lpthread -g
and gdb reveals:
This is on a Nvidia Jetson TX2 with ubuntu 16.04.03 and kernel 4.4.38
The text was updated successfully, but these errors were encountered: