-
Notifications
You must be signed in to change notification settings - Fork 576
driver: mount wsl lib folder for docker-container driver #3320
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
Conversation
Following up on #3295 (comment).
|
Thanks for your feedback, can you show the output of |
|
@pechersky Seems you're not using a development version of buildx to test changes of this PR. You can build it on your side with https://github.com/docker/buildx?tab=readme-ov-file#building:
After testing don't forget to remove the binary:
|
Great! After deleting the previous builder, and rerunning, I get the expected output, I think.
|
Yes looks good great! |
Signed-off-by: CrazyMax <[email protected]>
Strangely, if I rerun the
|
Can you show the output of |
|
Just to note -- if I delete the builder, then recreate it, then rerun the |
Hum I'm not able to repro. First build:
Second build:
Third build:
I'm not sure what would make |
@tonistiigi Btw I think there is an issue with ondemand and autoallow behavior. When I create a builder with nvidia build tag:
And inspect it before doing a build I have:
After first build then I get:
If I restart the Docker Engine and inspecting this builder again I have:
I think as the generated CDI specification is loaded from the build, it takes precedence over the OnDemand and therefore the device is not automatically allowed anymore. |
Sorry for the noise. I understand now that the |
It's available within the builder container on device request right before the build.
Great 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems requesting GPU on container builder creation introduced in #3063 is not enough as some libraries are missing on WSL.
If that is the case, isn't this a bug in Moby if --gpus
does not work correctly?
It works but not for nested containers, I will make a repro with dind to make sure of it. |
In that case, I think we need to detect the dind environment more precisely. I see you have |
It's not really detecting the dind environment. When we create the container builder and request gpus: buildx/driver/docker-container/driver.go Lines 161 to 163 in c6d1e39
Moby will run the nvidia container runtime prestart hook that checks whether NVIDIA devices are requested and ensures GPU access is configured using the In such case, necessary libraries are mounted and GPU is detected with cc @elezar |
As a naive question: Some of the output above referred to @crazy-max in the WSL case, where is the "outer" CDI spec being created (or should it be created)? Is this in the WSL2 distribution? Could a spec be generated For Docker Desktop as the VM is being started? On a related note, I have created moby/moby#50228 as a placeholder for migrating the |
Yes we have the device name format defined here: https://docs.docker.com/reference/dockerfile/#run---device:
We don't handle CDI specs from the host for the container builder case atm. We use the
Yes good point, that might be something Docker Desktop could do.
Ah that looks ideal, I see the |
follow-up #23069 (comment) ## Related issues or tickets * docker/buildx#3320 ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review Signed-off-by: CrazyMax <[email protected]>
relates to #3295 (comment)
When generating the CDI spec during build for a container builder created on WSL it fails with:
It seems requesting GPU on container builder creation introduced in #3063 is not enough as some libraries are missing on WSL.
To fix this issue we can mount the WSL libraries in the container if docker context is local.
Inspecting the CDI spec we can see
libdxcore.so
is properly detected and mounted: