OK, I found a very simple way of rebooting my box with a piece of CUDA code.
I’m running an example from the SDK in a bash loop, and this causes the reboot of my box. Besides this example code, the box is running standard Ubuntu-10.04 stuff and none of my custom code. Postgres server is not being queried.
I’ve added three printouts to the example `~/CUDA-SDK-3_2/C/src/BlackScholes/BlackSholes.cu’, in order to see what part of the executable causes the reboot. My additional code is easy to spot: it’s not indented, and the printouts start with “CUDESNICK:”.
shrLog("CUDESNICK: Starting iterations\n");
for(i = 0; i < NUM_ITERATIONS; i++){
BlackScholesGPU<<<480, 128>>>(
d_CallResult,
d_PutResult,
d_StockPrice,
d_OptionStrike,
d_OptionYears,
RISKFREE,
VOLATILITY,
OPT_N
);
cutilCheckMsg("BlackScholesGPU() execution failed\n");
}
shrLog("CUDESNICK: Loop completed\n");
cutilSafeCall( cudaThreadSynchronize() );
shrLog("CUDESNICK: Synchronized\n");
I then compiled the example by running make' within directory
~/CUDA-SDK-3_2/C/src/BlackScholes/'.
One can see from the following printout that the system crashes while the code is within cudaThreadSynchronize().
~/CUDA-SDK-3_2/C/bin/linux/release>for i in `seq 1 100`; do echo "CUDESNICK-SHELL: Invoking BlackSholes for the ${i}th time"; ./BlackScholes --noprompt; done
CUDESNICK-SHELL: Invoking BlackSholes for the 1th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.237635 msec
Effective memory bandwidth: 18.878456 GB/s
Gigaoptions per second : 1.887846
BlackScholes, Throughput = 1.8878 GOptions/s, Time = 0.00424 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 2th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.236279 msec
Effective memory bandwidth: 18.884495 GB/s
Gigaoptions per second : 1.888450
BlackScholes, Throughput = 1.8884 GOptions/s, Time = 0.00424 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 3th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.235482 msec
Effective memory bandwidth: 18.888050 GB/s
Gigaoptions per second : 1.888805
BlackScholes, Throughput = 1.8888 GOptions/s, Time = 0.00424 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 4th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.237184 msec
Effective memory bandwidth: 18.880466 GB/s
Gigaoptions per second : 1.888047
BlackScholes, Throughput = 1.8880 GOptions/s, Time = 0.00424 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 5th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.234685 msec
Effective memory bandwidth: 18.891604 GB/s
Gigaoptions per second : 1.889160
BlackScholes, Throughput = 1.8892 GOptions/s, Time = 0.00423 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 6th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.235549 msec
Effective memory bandwidth: 18.887752 GB/s
Gigaoptions per second : 1.888775
BlackScholes, Throughput = 1.8888 GOptions/s, Time = 0.00424 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 7th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.235885 msec
Effective memory bandwidth: 18.886255 GB/s
Gigaoptions per second : 1.888626
BlackScholes, Throughput = 1.8886 GOptions/s, Time = 0.00424 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 8th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
CUDESNICK: Synchronized
Options count : 8000000
BlackScholesGPU() time : 4.236287 msec
Effective memory bandwidth: 18.884461 GB/s
Gigaoptions per second : 1.888446
BlackScholes, Throughput = 1.8884 GOptions/s, Time = 0.00424 s, Size = 8000000 options, NumDevsUsed = 1, Workgroup = 128
Reading back GPU results...
Checking the results...
...running CPU calculations.
Comparing the results...
L1 norm: 1.691779E-07
Max absolute error: 1.239777E-05
Shutting down...
...releasing GPU memory.
...releasing CPU memory.
Shutdown done.
[BlackScholes] - Test Summary
PASSED
./BlackScholes Exiting...
-----------------------------------------------------------
CUDESNICK-SHELL: Invoking BlackSholes for the 9th time
[BlackScholes]
./BlackScholes Starting...
Initializing data...
...allocating CPU memory for options.
...allocating GPU memory for options.
...generating input data in CPU mem.
...copying input data to GPU mem.
Data init done.
Executing Black-Scholes GPU kernel (512 iterations)...
CUDESNICK: Starting iterations
CUDESNICK: Loop completed
The box reboots right after the last message of the above log.
The number of invocations of the SDK example before the system reboot varies, but I haven’t seen it go above twelve.