Don't use an overlay for the gpu libraries if the inbox folder isn't present (#40969)
* Don't use an overlay for the gpu libraries if the inbox folder isn't present * Remove comment
Blue committed
Jul 2, 2026 at 10:09 UTC
cba9474e912199761dca66536dac6fad316697ca
1 file changed
+16
-9
src/windows/wslcsession/WSLCVirtualMachine.cpp
+16
-9
@@ -1200,19 +1200,26 @@ void WSLCVirtualMachine::MountGpuLibraries(_In_ LPCSTR LibrariesMountPoint, _In_
1200
1201
#endif
1202
1203
- auto packagedLibMountPoint = std::format("{}/packaged", LibrariesMountPoint);
1204
- THROW_IF_FAILED(MountWindowsFolderImpl(packagedLibPath.c_str(), packagedLibMountPoint.c_str(), WSLCMountFlagsReadOnly));
1205
-
1206
- // Mount an overlay containing both inbox and packaged libraries (the packaged mount takes precedence).
1207
- std::string options = "lowerdir=" + packagedLibMountPoint;
1203
if (inboxLibMountPoint.has_value())
1204
{
1210
- options += ":" + inboxLibMountPoint.value();
1205
+ // Mount an overlay containing both inbox and packaged libraries (the packaged mount takes precedence).
1206
+ auto packagedLibMountPoint = std::format("{}/packaged", LibrariesMountPoint);
1207
+ THROW_IF_FAILED(MountWindowsFolderImpl(packagedLibPath.c_str(), packagedLibMountPoint.c_str(), WSLCMountFlagsReadOnly));
1208
+
1209
+ Mount(
1210
+ m_initChannel,
1211
+ "none",
1212
+ LibrariesMountPoint,
1213
+ "overlay",
1214
+ std::format("lowerdir={}:{}", packagedLibMountPoint, inboxLibMountPoint.value()).c_str(),
1215
+ 0);
1216
+ }
1217
+ else
1218
+ {
1219
+ // If the inbox libraries are not present, mount the packaged libraries directly at final location (no overlay needed).
1220
+ THROW_IF_FAILED(MountWindowsFolderImpl(packagedLibPath.c_str(), LibrariesMountPoint, WSLCMountFlagsReadOnly));
1221
}
1212
-
1213
- Mount(m_initChannel, "none", LibrariesMountPoint, "overlay", options.c_str(), 0);
1222
}
1215
-
1223
void WSLCVirtualMachine::OnProcessReleased(int Pid)
1224
{
1225
std::lock_guard lock{m_trackedProcessesLock};