Fix AMD_LOG_LEVEL_SIZE env variable (#2463)
AMD_LOG_LEVEL_SIZE is being used in a global variable. This always uses the default value of 2048 because the HIP runtime doesn't have the opportunity to load environment variables at the point where global variables are initialized. The solution is to use AMD_LOG_LEVEL_SIZE inside truncate_log_file() function.
このコミットが含まれているのは:
1 親
35a5274b84
コミット
61325db1c8
1ファイル変更
+2
-1
@@ -40,13 +40,14 @@
|
||||
namespace amd {
|
||||
|
||||
FILE* outFile = stderr;
|
||||
const size_t maxLogSize = AMD_LOG_LEVEL_SIZE * Mi;
|
||||
|
||||
// ================================================================================================
|
||||
void truncate_log_file() {
|
||||
if (outFile != stderr) {
|
||||
fseek(outFile, 0, SEEK_END);
|
||||
long size = ftell(outFile);
|
||||
|
||||
const size_t maxLogSize = AMD_LOG_LEVEL_SIZE * Mi;
|
||||
if (size > maxLogSize) {
|
||||
if (nullptr == freopen(NULL, "w", outFile)) {
|
||||
outFile = stderr;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする