Skip to content

Commit

Permalink
Fix setting up overlay with nvidia files
Browse files Browse the repository at this point in the history
- make them override (likely older version) in the task image
- fix resolving squashfs path

Fixes https://github.com/fepitre/golem-gpu-live/issues/8
  • Loading branch information
marmarek committed Nov 17, 2023
1 parent 6e19baf commit c7fd377
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runtime/init-container/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ int main(int argc, char **argv) {
CHECK(mkdir("/mnt/gpu-files", S_IRWXU));
CHECK(mount("/dev/vdb", "/mnt/gpu-files", "squashfs", MS_RDONLY | MS_NODEV, ""));
CHECK(mount("overlay", SYSROOT, "overlay", MS_NODEV,
"lowerdir=/mnt/image:/mnt/gpu-files,upperdir=/mnt/overlay/upper,workdir=/mnt/overlay/work"));
"lowerdir=/mnt/gpu-files:/mnt/image,upperdir=/mnt/overlay/upper,workdir=/mnt/overlay/work"));
} else {
CHECK(mount("overlay", SYSROOT, "overlay", MS_NODEV,
"lowerdir=/mnt/image,upperdir=/mnt/overlay/upper,workdir=/mnt/overlay/work"));
Expand Down
4 changes: 2 additions & 2 deletions runtime/src/vmrt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ pub async fn start_vmrt(
cmd.arg("none");
}

if Path::new(FILE_NVIDIA_FILES).exists() {
if runtime_dir.join(FILE_NVIDIA_FILES).exists() {
cmd.arg("-drive");
cmd.arg(
format!(
"file={},cache=unsafe,readonly=on,format=raw,if=virtio",
FILE_NVIDIA_FILES
runtime_dir.join(FILE_NVIDIA_FILES).display()
)
.as_str(),
);
Expand Down

0 comments on commit c7fd377

Please sign in to comment.