Unable to run deviceQuery sample after CUDA 11.6 install on Ubuntu 20.04

I have installed CUDA through a .deb network installation using the download linked from the cuda installation documentation.

I have reasonable output from nvidia-smi:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.47.03    Driver Version: 510.47.03    CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
|  0%   33C    P8     6W / 200W |    313MiB /  8192MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1022      G   /usr/lib/xorg/Xorg                102MiB |
|    0   N/A  N/A      1568      G   /usr/lib/xorg/Xorg                187MiB |
|    0   N/A  N/A      1697      G   /usr/bin/gnome-shell               11MiB |
+-----------------------------------------------------------------------------+

and from cat /proc/driver/nvidia/version:

NVRM version: NVIDIA UNIX x86_64 Kernel Module  510.47.03  Mon Jan 24 22:58:54 UTC 2022
GCC version: 

I’m also able to compile the deviceQuery sample. However, when I run the sample I get the following output:

$ ./deviceQuery                  
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 999
-> unknown error
Result = FAIL

Looking around I saw that it could because of a mismatch between CUDA toolkit and drivers, but mine seem to match. My system also has secureboot enabled, but I went through the signing process during install.

Does anyone have an idea of something I may have missed?

I resolved the issue.

For anyone looking in the future. I had to complete the process to enroll my MOK key for UEFI SecureBoot, see details here: SecureBoot - Debian Wiki.

I had created the key, but had not finished the process of enrolling it on a new bootup.