Create devcontainer with accelerated gpu support?

Hi,

I wanted to start learning libcosmic in Rust in order to do some GUI development but all the settings I could find for devcontainers would get me unaccelerated GUI support, so the app renders but it doesn’t render well, is unresponsive and sometimes just crashes. Rn I have created a distrobox with ubuntu and linked my RustRover instance to there and if I do everything from distrobox it works perfectly fine.

Does someone know what packages or mounts I need to add to my devcontainer config so I get GPU support? I am on Nvidia (like always with graphical issues) if that makes a difference. I was using this config as a base:

I use this argument in my .devcontainer, and I get gpu and cuda access. Hope it works for what you need!

	"runArgs": [
		"--gpus",
		"all"
	],
2 Likes