CUDA headers not included in cudatoolkit?

Hi everyone,

Possible major newbie question here: I’d like to compile an program that includes the cuda_runtime_api.h header. I would think that this would be included in the systemPackage cudatoolkit, but unfortunately it doesn’t seem to be.

Several people on the web have suggested that, to do CUDA development under NixOS, you need to include the following in your configuration.nix: = {
  wantedBy = [ "" ];
  serviceConfig.ExecStart = "${pkgs.linuxPackages.nvidia_x11}/bin/nvidia-smi";

but when I add this and run # nixos-rebuild switch, the service fails with the error

... systemd[22581]: nvidia-control-devices.service: Failed to execute command: No such file or directory

Someone else had a similar issue in this question, and seemed to be able to resolve it by working in a nix-shell–but I’m pretty sure this is not what I want (as I do want a global installation), and I’m such a beginner that I’m not sure how to adapt it!

Any help would be much appreciated, both with this issue directly, and the more general hairy question of discoverability (I know how to search NixOS packages, but this doesn’t always make it obvious how or where or in what package some program or library is provided!).

Thanks very much.