SDK Examples not running on GPU Ubuntu 7.10 server (i.e. no X)

Hi again

I’ve got the SDK examples to build now (see other posts). Here’s an example output:

az@AzCUDA:~/NVIDIA_CUDA_SDK/bin/linux/release$ ./MersenneTwister
NVIDIA: could not open the device file /dev/nvidiactl (No such file or directory).
Using device 0: Device Emulation (CPU)
Initializing data for 24000000 samples…
Loading CPU and GPU twisters configurations…
Generating random numbers on GPU…
Generated samples : 24002560
RandomGPU() time : 0.044000
Samples per second: 5.455127E+11
Applying Box-Muller transformation on GPU…
Transformed samples : 24002560
BoxMullerGPU() time : 0.040000
Samples per second : 6.000640E+11
Reading back the results…
Checking GPU results…
…generating random numbers on CPU using reference generator
…applying Box-Muller transformation on CPU
…comparing the results
Max absolute error: 5.283487E+00
L1 norm: 1.000000E+00
TEST FAILED
Shutting down…

Press ENTER to exit…

So it seems that the GPU (9500GT) is not being used and the CPU is emulating the GPU.

Toolkit release notes say X needs to be started for it to work. I don’t have X on this machine and would rather not install it. I have seen a post with a script for initialising the card, but its for RHEL and won’t work as-is on ubuntu (and my linux skills aren’t up to converting it unfortunately)

Can somebody please advice if there’s a way to get it workling without installing X?

Many thanks
virgesmith

Great news I’ve got the GPU working without X! I managed to modify the RHEL script, only things I needed to do was the location of lspci and add success and failure functions. See below.

Here’s the proof!

az@AzCUDA:~$ NVIDIA_CUDA_SDK/bin/linux/release/deviceQuery

There is 1 device supporting CUDA

Device 0: “GeForce 9500 GT”

Major revision number: 1

Minor revision number: 1

Total amount of global memory: 536150016 bytes

Number of multiprocessors: 4

Number of cores: 32

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 8192

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 1.50 GHz

Concurrent copy and execution: Yes

Test PASSED

[codebox]

#!/bin/bash

Startup/shutdown script for nVidia CUDA

chkconfig: 345 80 20

description: Startup/shutdown script for nVidia CUDA

Source function library.

#. /etc/init.d/functions

DRIVER=nvidia

RETVAL=0

function success()

{

return 0

}

function failure()

{

echo ERROR

return 0

}

Create /dev nodes for nvidia devices

function createnodes() {

Count the number of NVIDIA controllers found.

N3D=/usr/bin/lspci | grep -i NVIDIA | grep "3D controller" | wc -l

NVGA=/usr/bin/lspci | grep -i NVIDIA | grep "VGA compatible controller" | wc -l

N=expr $N3D + $NVGA - 1

for i in seq 0 $N; do

   mknod -m 666 /dev/nvidia$i c 195 $i

   RETVAL=$?

   [ "$RETVAL" = 0 ] || exit $RETVAL

done

mknod -m 666 /dev/nvidiactl c 195 255

RETVAL=$?

[ “$RETVAL” = 0 ] || exit $RETVAL

}

Remove /dev nodes for nvidia devices

function removenodes() {

rm -f /dev/nvidia*

}

Start daemon

function start() {

echo -n $"Loading $DRIVER kernel module: "

modprobe $DRIVER && success || failure

RETVAL=$?

echo

[ “$RETVAL” = 0 ] || exit $RETVAL

echo -n $"Initializing CUDA /dev entries: "

createnodes && success || failure

RETVAL=$?

echo

[ “$RETVAL” = 0 ] || exit $RETVAL

}

Stop daemon

function stop() {

echo -n $"Unloading $DRIVER kernel module: "

rmmod -f $DRIVER && success || failure

RETVAL=$?

echo

[ “$RETVAL” = 0 ] || exit $RETVAL

echo -n $"Removing CUDA /dev entries: "

removenodes && success || failure

RETVAL=$?

echo

[ “$RETVAL” = 0 ] || exit $RETVAL

}

See how we were called

case “$1” in

start)

   start

  ;;

stop)

   stop

  ;;

restart)

   stop

   start

  ;;

*)

   echo $"Usage: $0 {start|stop|restart}"

   RETVAL=1

esac

exit $RETVAL

[/codebox]

Hi,

I have been trying to get CUDA to work without X and I had gotten to init.d myself, but got stuck. So your post was most timely. It was nice to see some progess.

Thanks for the post.

S