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 increasing gpu_mem for Raspberry PI #1142

Open
M-Gregoire opened this issue Sep 26, 2024 · 3 comments
Open

Allow increasing gpu_mem for Raspberry PI #1142

M-Gregoire opened this issue Sep 26, 2024 · 3 comments

Comments

@M-Gregoire
Copy link
Member

Hello 👋 ,

After installing NixOS and using nixos-hardware to setup my Raspberry Pi 4, the allocated GPU memory is 76M.

# vcgencmd get_mem gpu
gpu=76M

I'd like to increase it to at least 128M. I believe the standard way would have been:

  boot.loader.raspberryPi = {
    enable = true;
    firmwareConfig = ''
      gpu_mem=128
    '';
  };

But I've read in an other issue that firmwareConfig is gonna be deprecated.

I'm not quite sure what it the proper way to increase the memory allocation for the GPU.

Any help would be appreciated :)

@Mic92
Copy link
Member

Mic92 commented Sep 27, 2024

Not sure if this can be actually deprecated because I assume that the bootloader won't respect dts. At least this is my understanding. So firmwareConfig is probably still the way to go?

@M-Gregoire
Copy link
Member Author

Thank you for your answer.

I've tried the snippet above which produced the following error :

Failed assertions:
       - Only Raspberry Pi >= 3 supports aarch64.

(Coming from here) when the target is a Raspberry pi 4 with
nixos-hardware.nixosModules.raspberry-pi-4 in it's flake.

So, upon further inspection, it seems that It might be because firmwareConfig requires loader.raspberryPi (Here) where nixos-hardware defaults to the generic one (here).

Documentation for loader.raspberryPi.enable states:

Whether to create files with the system generations in /boot. /boot/old will hold files from old generations.

These options are deprecated, unsupported, and may not work like expected.

So it does feel like this might be not the right way to go with this, but again, I'm not quite sure how to change the gpu_mem otherwise.

Would you have any advice by any chance?

@Mic92
Copy link
Member

Mic92 commented Oct 8, 2024

You may need to set the version to 4 as well to avoid the evaluation error that you see.

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

No branches or pull requests

2 participants