Skip to content
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

plugin: Change default max buffer size to 4G #2293

Open
wants to merge 1 commit into
base: criu-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Documentation/criu-amdgpu-plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ executing criu command.
*KFD_MAX_BUFFER_SIZE*::
On some systems, VRAM sizes may exceed RAM sizes, and so buffers for dumping
and restoring VRAM may be unable to fit. Set to a nonzero value (in bytes)
to set a limit on the plugin's memory usage.
Default:0 (Disabled)
to set a limit on the plugin's memory usage. Set to 0 to disable.
Default:4 Gigabytes

E.g:
KFD_MAX_BUFFER_SIZE="2G"
Expand Down
2 changes: 1 addition & 1 deletion plugins/amdgpu/amdgpu_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ int amdgpu_plugin_init(int stage)
getenv_bool("KFD_NUMA_CHECK", &kfd_numa_check);
getenv_bool("KFD_CAPABILITY_CHECK", &kfd_capability_check);
}
kfd_max_buffer_size = 0;
kfd_max_buffer_size = 4 << 30;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amdgpu_plugin.c: In function 'amdgpu_plugin_init':
50499
amdgpu_plugin.c:524:33: error: result of '4 << 30' requires 34 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
50500
524 | kfd_max_buffer_size = 4 << 30;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fdavid-amd I think size_t can be 32-bits depending on the compiler used. So probably safer to change
size_t kfd_max_buffer_size;
to:
uint64_t kfd_max_buffer_size;
and most of the occurrences where we use size_t to uint64_t

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark the symbol as static If the symbol is used only in amdgpu_plugin.c

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fdavid-amd any ETA on these changes?

getenv_size_t("KFD_MAX_BUFFER_SIZE", &kfd_max_buffer_size);

return 0;
Expand Down
Loading