.run file fails after compilation with 'Unable to determine if Secure Boot is enabled: no such file

I have a new ASUS desktop system that has a GTX 745 graphics card. I have installed Debian Jessie with 3.16.7 kernel and the latest Beta driver, 346.22, although I’ve tried several drivers and the .run file always stops execution at the same place. I’ve included part of the installer.log file here. The bug-report.sh never gets installed since the .run file never actually installs the driver.

I’ve been trying for days to get this to work. Hopefully someone can help.

nvidia-installer log file ‘/var/log/nvidia-installer.log’
creation time: Tue Jan 6 12:28:00 2015
installer version: 346.22

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

nvidia-installer command line:
./nvidia-installer

Using: nvidia-installer ncurses user interface
-> Detected 4 CPUs online; setting concurrency level to 4.
-> License accepted.
-> Installing NVIDIA driver version 346.22.
-> Performing CC sanity check with CC="/usr/bin/cc".
-> The CC version check failed:

The compiler used to compile the kernel (gcc 4.8) does not exactly match the current comp
iler (gcc 4.9). The Linux 2.6 kernel module loader rejects kernel modules built with a v
ersion of gcc that does not exactly match that of the compiler used to build the running
kernel.

If you know what you are doing you can either ignore the CC version check and continue in
stallation, or abort installation, set the CC environment variable to the name of the com
piler used to compile your kernel, and restart installation. (Answer: Ignore CC version c
heck)
-> Kernel source path: ‘/lib/modules/3.16.0-4-amd64/source’
-> Kernel output path: ‘/lib/modules/3.16.0-4-amd64/build’
-> Performing rivafb check.
-> Performing nvidiafb check.
-> Performing Xen check.
-> Performing PREEMPT_RT check.
-> Cleaning kernel module build directory.
executing: ‘cd ./kernel; /usr/bin/make clean’…

-> done.
-> Kernel module compilation complete.
-> Unable to determine if Secure Boot is enabled: No such file or directory
ERROR: Unable to load the kernel module ‘nvidia.ko’. This happens most frequently when t
his kernel module was built against the wrong or improperly configured kernel sources, wi
th a version of gcc that differs from the one used to build the target kernel, or if a dr
iver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel modul
e from obtaining ownership of the NVIDIA graphics device(s), or no NVIDIA GPU installed i
n this system is supported by this NVIDIA Linux graphics driver release.

Please see the log entries ‘Kernel module load error’ and ‘Kernel messages’ at the end of
the file ‘/var/log/nvidia-installer.log’ for more information.
-> Kernel module load error: No such device
-> Kernel messages:
[ 11.004532] Installing knfsd (copyright © 1996 okir@monad.swb.de).
[ 11.102801] Adding 16524284k swap on /dev/sda5. Priority:-1 extents:1 across:16524284
k FS
[ 13.069015] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 13.069082] Bluetooth: BNEP filters: protocol multicast
[ 13.069155] Bluetooth: BNEP socket layer initialized
[ 92.934040] systemd-journald[169]: Received request to flush runtime journal from PID
1
[ 95.698068] e1000e 0000:00:19.0: irq 42 for MSI/MSI-X
[ 95.800109] e1000e 0000:00:19.0: irq 42 for MSI/MSI-X
[ 95.800187] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 98.703187] e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
[ 98.703215] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 3939.052141] nvidia: module license ‘NVIDIA’ taints kernel.
[ 3939.052144] Disabling lock debugging due to kernel taint
[ 3939.058482] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes
=none:owns=none
[ 3939.058498] NVRM: The NVIDIA GPU 0000:01:00.0 (PCI ID: 10de:1382)
NVRM: installed in this system is not supported by the 346.22
NVRM: NVIDIA Linux driver release. Please see ‘Appendix
NVRM: A - Supported NVIDIA GPU Products’ in this release’s
NVRM: README, available on the Linux driver download page
NVRM: at www.nvidia.com.
[ 3939.058526] nvidia: probe of 0000:01:00.0 failed with error -1
[ 3939.058704] NVRM: The NVIDIA probe routine failed for 1 device(s).
[ 3939.058706] NVRM: None of the NVIDIA graphics adapters were initialized!
[ 3939.058707] [drm] Module unloaded
[ 3939.058786] NVRM: NVIDIA init module failed!
ERROR: Installation has failed. Please see the file

The .run files from every driver I try, in every kernel I try, fails the same way. That message ‘Unable to tell if Secure Boot is enabled, no such file or directory’ leads me to hope that the fix here is something as simple as putting a file somewhere with the contents ‘no’.

You obviously know what you are doing. What is your question?

I’ve gone through these suggestions point by point over the past few days. I have run this with the same gcc version, blacklisted nouveau drivers and double checked the card type. Posting here is the result of much head scratching over many days. The machine came preinstalled with Windows 8.1 with Secure Boot enabled. I disabled it and enabled CSM mode in the Bios just to get the machine to boot a USB key.

Anyway, I’ve tried everything I can think of and the error remains. If I try binary drivers, I can get them to load but not to run. All I get is a blank screen, sometimes with a flashing cursor.

So, my question is; What does this error message mean and how can I fix it?

Instead of trying to install a beta version with nvidia’s binary installer, you should stick to what is provided properly packaged for your distribution, like here: https://packages.debian.org/jessie/xserver-xorg-video-nvidia