Support for CUDA, JetPack in snap applications

Hello Forum,

I happen to be using a TX2 but this isn’t really specific to the TX2.

I’m investigating the use of snap application containers for production systems. I see the snapd service is included in L4T but I’m struggling to enable CUDA/GPU support from within Snap containers. I’ve created a project on GitHub which attempts to establish the L4T/CUDA userspace runtime by extracting the debians included in the L4T image. I’m able to get GPU information from the device via cudaGetDeviceCount and cudaGetDeviceProperties, but my two test programs which attempt to add vectors of numbers doesn’t appear to actually run (despite no errors being returned from the cuda calls). I’ve also tried installing my snap without any AppArmor confinement (–devmode) with no luck. The and samples I’m using do run correctly when compiled directly on L4T, outside of the snap setup.

I’m curious if anyone’s successfully gotten CUDA support working inside confined snap applications. Presumably I’ve done something wrong with setting up the CUDA/L4T runtime in my application. Is there any information/documentation that describes the userspace stack required for CUDA programs on the Jetson platform?

Thanks & Best,


Sorry for the late reply.

You will need to enable the GPU access for the container.
If possible, you can build the image on the top of our l4t container.
It handles all the GPU related thing for you already.

If above is not an option, please check this GitHub for how to enable the GPU access manually.