-
Notifications
You must be signed in to change notification settings - Fork 9
Description
After starting up the container, opening an existing Diamond project, and then going to Tools > Programmer, the main container process (i.e. the Diamond IDE) exits due to a segfault. For the physical programmer, I am using a Lattice HW-USBN-2B programmer cable. Note that I also manually named the docker container and prevented it from being deleted after exiting.
Checking the container logs I see this:
user@host:~/docker-fpga/lattice-diamond$ docker logs diamond-3.11-sp1
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
/opt/docker-fpga/run.sh: line 5: 9 Segmentation fault (core dumped) diamond
Indeed, the USB device file is only writable by root:
user@host:~$ ls -l /dev/bus/usb/002/006
crw-rw-r-- 1 root root 189, 133 Dec 20 12:12 /dev/bus/usb/002/006
Is this expected? The user I am running the container under is a member of the "docker" group so it is able to run docker commands however it is not running as the root user of the host so the permission problems are to be expected if it is trying to write to /dev/bus/usb/002/006
. I also tried using sudo docker start diamond-3.11-sp1
to re-start the existing container as root but I still got the same permission problems followed by a segfault.
What is the proper solution here? Perhaps a udev rule is needed for the programmer?