WSL2 jetson inference /dev/video0

Hi,

I know this may not be right forum to ask this question. but i don’t where to ask. Pls help me if you have clues

I have 5.10.16.3-microsoft-standard-WSL2 running on my laptop

I have successfully build jetson_inference

when i try to execute ./detectnet /dev/ i can’t find video0 available

I have usb camera however connected to laptop. it works in windows, but i don’t know how to get it work with WSL2

Hi,

Sorry that we don’t have too much experience on this.
But below may give you some idea:

https://github.com/microsoft/WSL/issues/5158

Thanks.

I know nothing about WSL2, nor really about detectnet. I just wanted to add some information about “/dev/video#” which you might find useful. This assumes running on real Linux.

The pseudo devices in “/dev” are typically created by device drivers. These are not “real” files, and thus called “pseudo” files. The generation of a file like “/dev/video0” is a result of the driver loading in the kernel, and the driver finding hardware to work with. Mostly I think this is for USB video, and when a USB camera is detected which uses a standard USB video class driver, then this is created. The udev system can also be involved, but probably is irrelevant for this driver.

  • If Windows does not pass the device through on USB to WSL2, then the device cannot be found, and thus no driver can load.
  • If Windows does pass through the USB, but there is no standard driver (USB UVC driver), then there will be no “/dev/video0”. This is VERY unlikely since I’ve never heard of a working USB system which does not have the “standard class” drivers.
  • If Windows does pass through USB, but the camera is not a UVC class, then you need a custom driver and no “/dev/video0” would be created. Make sure the camera is truly UVC. Because of the generation of “/dev/video0” on your laptop I have to conclude that the device is in fact truly UVC and this is not a problem.
  • udev could rename this device, but this is extremely unlikely.

Basically, there is a strong possibility that either: (A) USB is not being passed through to WSL2, or (B) WSL2 does not have a driver for USB UVC cameras (I don’t use WSL2, but since such drivers require the Linux kernel, the possibility is significant). Don’t know if WSL2 has logging for USB plugin, but if it does, then monitor the log as you connect the camera.