WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL2 docker image cannot use gpu on other server

Open happylee524 opened this issue 4 years ago • 2 comments

Version

21H2

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

  1. I create a docker container with gpu docker run --gpus all -it {image_id} bash
  2. Install my python packages
  3. I commit my container as a image docker commit {cotainer_id} {image_name}:{tag}
  4. Run the image in server via k8s
  5. can't use gpu in the new container(k8s pod)
  6. the bug infos as : `ldconfig

/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so is empty, not checked.

/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libcuda.so.1 is empty, not checked.

/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libdxcore.so is empty, not checked.

/sbin/ldconfig.real: File /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1 is empty, not checked.

/sbin/ldconfig.real: /usr/lib/x86_64-linux-gnu/libcuda.so.1 is not a symbolic link`

  1. I modify libcuda.so and libnvidia-smi soft link then it work `rm -f /usr/lib/x86_64-linux-gnu/libcuda.so /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1

ln -s /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.510.47.03 /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1

ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so`

Expected Behavior

who can tell me why

Actual Behavior

none

Diagnostic Logs

No response

happylee524 avatar Apr 12 '22 09:04 happylee524

This doesn't seem like a wsl issue but an issue with the specific container image you're using or docker (the only thing WSL does is mount libdxcore.so)

OneBlue avatar Apr 12 '22 21:04 OneBlue

i have the same issue, when build a gpu images by --gpus all。and then run this image on another linux server.

nmber5 avatar Nov 01 '22 14:11 nmber5