0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-11 06:28:55 +02:00

ircd::gpt::model: Fixes for amdgpu mmaps; reenable mapping by default.

This commit is contained in:
Jason Volk 2022-10-16 21:12:29 +00:00
parent 1ac69df8cd
commit 47117dde9a

View file

@ -93,7 +93,7 @@ decltype(ircd::gpt::model::cache_mapped)
ircd::gpt::model::cache_mapped ircd::gpt::model::cache_mapped
{ {
{ "name", "ircd.gpt.model.cache.mapped" }, { "name", "ircd.gpt.model.cache.mapped" },
{ "default", false }, { "default", true },
}; };
decltype(ircd::gpt::model::cache_locked) decltype(ircd::gpt::model::cache_locked)
@ -273,8 +273,13 @@ ircd::gpt::model::init_from_cache(const string_view &cache_path)
.locked = bool(cache_locked), .locked = bool(cache_locked),
.huge2mb = bool(cache_hugepage), .huge2mb = bool(cache_hugepage),
}; };
map_opts.mode = mode; map_opts.mode = mode;
// amdgpu requires both anon and shms to be read-write even if we
// open the fd read-only and use read-only cl_mems.
if(cache_mapped)
map_opts.mode |= std::ios::out;
default_model_shm = fs::map default_model_shm = fs::map
{ {
fd, map_size, map_opts, fd, map_size, map_opts,