Skip to content
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

Allow for udev rules without devnode #521

Closed
agracey opened this issue Sep 26, 2022 · 5 comments · Fixed by #534
Closed

Allow for udev rules without devnode #521

agracey opened this issue Sep 26, 2022 · 5 comments · Fixed by #534

Comments

@agracey
Copy link

agracey commented Sep 26, 2022

Is your feature request related to a problem? Please describe.

I'm trying to get Akri to detect if a display is connected or not then schedule an X11 container to it. I found the correct rule but Akri doesn't seem to like it.

Is your feature request related to a way you would like Akri extended? Please describe.

Currently, when I use the rule SUBSYSTEM=="drm", ATTR{status}=="connected" I see the below in the logs:

find_devices - ignoring device with devpath "/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1" due to having no devnode

I would imagine this is because the drm subsystem is at /sys/class/drm/?

Describe the solution you'd like
I would like for udev rules without devnodes to be allowed in the udev discovery handler

Describe alternatives you've considered
I don't think there are alternatives?

@agracey
Copy link
Author

agracey commented Sep 26, 2022

I'm looking at the traceback from

"find_devices - ignoring device with devpath {:?} due to having no devnode",

I think there might be 2 options:

  • I build a custom discovery handler based on the udev handler that uses something other than devnode
  • If get_devnode(&device) returns None, you could optionally return a predictable name based on the KERNEL or SUBSYSTEM and the node name

@kate-goldenring
Copy link
Contributor

Hi @agracey. I think option 1 is a good route and one that we have discussed before in Slack (https://kubernetes.slack.com/archives/C01D9L7QE8Z/p1662486545856829?thread_ts=1662022333.544559&cid=C01D9L7QE8Z). It seems that using syspath rather than devnode would be more ideal which would keep device ids more deterministic too.

@agracey
Copy link
Author

agracey commented Oct 1, 2022

I went with option 1: https://github.com/agracey/display-discovery and it works!

An example of it's use is here: https://gist.github.com/agracey/96cfa8c150687ec43b0ca18d42c05332

Should I close this? Or rename to reflect the previously discussed syspath change that you linked (for some reason slack isn't deep-linking for me so I can't actually see the conversation ☹️)?

@kate-goldenring
Copy link
Contributor

@agracey looks like you are using devpath if devnode does not exist. Should we just always use devpath/syspath? Then rather than a custom DH we could just update the current udev one? Great that you were able to create a DH to get things going in the meantime.

@agracey
Copy link
Author

agracey commented Dec 8, 2022

🎉 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants