CUDA without X Window System

· klm's blog


Original post is here: eklausmeier.goip.de

Instead of starting X like

xinit /usr/bin/icewm

and therefore loading the NVidia CUDA environment, one can simply add

[ -c /dev/nvidia0 ] || mknod -m 666 /dev/nvidia0 c 195 0
[ -c /dev/nvidiactl ] || mknod -m 666 /dev/nvidiactl c 195 255

[more_WP_Tag]to /etc/init.d/boinc-client assuming one has a single graphic card. See "NVidia CUDA Getting Started Guide for Linux", which is part of the CUDA Toolkit. The test statement is to cope for set -e in init-scripts.

If one has errors like

... kernel: [  174.536638] NVRM: Your system is not currently configured to drive a VGA console
... kernel: [  174.536640] NVRM: on the primary VGA device. The NVIDIA Linux graphics driver
... kernel: [  174.536643] NVRM: requires the use of a text-mode VGA console. Use of other console
... kernel: [  174.536645] NVRM: drivers including, but not limited to, vesafb, may result in
... kernel: [  174.536647] NVRM: corruption and stability problems, and is not supported.

then add video=vesa:off vga=normal in GRUB, i.e.,

menuentry 'Ubuntu, with Linux 3.2.0-40-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root 242bfd68-bd16-4c6a-91e4-d37362d9eabb
        linux   /vmlinuz-3.2.0-40-generic root=UUID=d471cc6b-d964-4841-9640-178e20720f1a ro <strong><span style="color:#2233ff;">video=vesa:off vga=normal</span></strong>
        initrd  /initrd.img-3.2.0-40-generic
}

To make this change permanent in GRUB one has to change file /etc/default/grub and change

GRUB_CMDLINE_LINUX_DEFAULT="video=vesa:off vga=normal"