Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
khronos: Use vchiq_get_client_id to determine global PID. #315
PID namespacing breaks VCHIQ as it uses PIDs as unique identifiers for VCHIQ services, meaning messages sent from userland will contain a different ID than the one expected by the GPU.
This patch addresses the problem uses the existing GET_CLIENT_ID ioctl (via
The main situation that causes this problem to occur is when trying to run code that interfaces with the GPU inside of a container (e.g. via EGL.)
I'm not certain this is the best means of achieving this aim, however I definitely think the fix belongs in the userland tools, as the kernel alternative is to either use the namespaced PID, which opens the door to conflicts (see raspberrypi/linux#1279) or to actively intercept messages and manually determine which part of the raw data contains the ID and replace it, which is potentially unreliable and adds overhead (see raspberrypi/linux#1382 - yes we've looked at this multiple different ways :)
I've tested this change against EGL applications and it works correctly with no noticeable issues, though of course it's hard to test all cases :)
I'd really love to get some feedback on this in case there is something I've missed or got wrong here. My main concerns in the approach I've taken here are:
Thanks in advance for taking a look at this!
referenced this pull request
May 18, 2016
I'm happy with the motivation behind the patch, and I think the implementation is correct. My hesitation has been on the grounds of a potential performance hit, but that doesn't seem to be a problem; if anything it seems marginally quicker:
I'm happy for this to be merged - @popcornmix ?