Troubleshoot Guide: Run with WSL (Windows)
ronnypollak opened this issue · 6 comments
As I faced some problems to make the demo run with WSL on Windows I want to present the steps I have followed to make it work in case anyone else is facing the same issues:
I prepared the repo locally on my Windows (clone the project, copy the weights and the demo data), then switch to the WSL and mount the direction of the project.
My steps in WSL were as follows:
- Initialize WSL with Ubuntu 24.04
- Install the Docker Engine: https://docs.docker.com/engine/install/ubuntu/
- Pull the docker image
- You can then try to run the run_container.sh, if it works congrats if not you could have one of these issues:
- xhost error -->
apt-get install x11-xserver-utils
"could not select device driver "" with capabilities: [[gpu]]."
--> NVIDIA/nvidia-docker#1034
--> nvidia container toolkit (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)
--> restart WSL session
Mount Error:
Fehler: access control disabled, clients can connect from any host docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
nvidia-container-cli: mount error: file creation failed: /var/lib/docker/overlay2/cbf69331937d06db8d5e99606517e3e05d95d5fca454e5551271dd1a924c6caa/merged/usr/lib/x86_64-linux-gnu/[libnvidia-ml.so](http://libnvidia-ml.so/).1: file exists: unknown
--> NVIDIA/nvidia-container-toolkit#289 (comment)
--> What I did here was:
- Create a new dockerfile, foundationpose-modified:
FROM foundationpose
RUN rm -rf /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so.1
- Create or modify: run_container-modified:
#!/bin/bash
# Remove any existing container named foundationpose
docker rm -f foundationpose
# Set the current directory
DIR=$(pwd)/../
# Allow connections to the X server
xhost +
# Run the Docker container using the modified image
docker run --gpus all --env NVIDIA_DISABLE_REQUIRE=1 -it --network=host --name foundationpose \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
-v $DIR:$DIR -v /home:/home -v /mnt:/mnt -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp:/tmp \
--ipc=host -e DISPLAY=${DISPLAY} -e GIT_INDEX_FILE \
foundationpose-modified bash -c "cd $DIR && bash"
- build it:
build -t foundationpose-modified .
- Then run the modified run_container-modified.sh
- run the build_all.sh
- run the demo
Thank you to @wenbowen123 for this project and for pointing to resources in other, related issues.
@wenbowen123 Should I move this issue to closed or delete it and post it elsewhere?
For what it is worth, other than dealing with the 4080/4090 issue, I had no issues getting it to run on wsl2. That said, I followed these instructions to set up gpu acceleration in wsl2: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gpu-compute. Most notably I followed the instructions for using docker desktop.
Just as a heads up, you may need to rebuild the wsl2 kernel if you want to use a camera with wsl2.
@bblumberg Thank you for the info. I will definitely check out the instructions. Have you already rebuilt your wsl2 kernel and tried it out with a camera?
Yup to use cameras with wsl2, you will typically need to rebuild the wsl2 kernel as the default version of Ubuntu 22.04 does not include video drivers. This sounds more complicated than it actually is in practice if you have a clear set of directions. Here are the instructions that I followed and they worked fine for me. (https://medium.com/software-dev-explore/wsl2-webcam-23c1dc9408ae )
@ronnypollak thanks a lot for contributing this! Will link to this in readme.
Would it be possible for y'all to assist me with my issue? (note: it's all resolved now; please check the reporting thread linked below for the details)