System specs: laptop with nvidia optimus support (geforce 740m, supports compute capability 2.0), ubuntu 13.10, cuda 5.0, optirun (Bumblebee) 3.2.1.
Im' trying to compile and run simpler version of example described here:
main.cu
#include "defines.h"
#include <cuda.h>
int main ()
{
hello<<<1, 1>>>();
cudaDeviceSynchronize();
}
defines.h
#include <cuda.h>
extern __global__ void hello(void);
defines.cu
#include <cstdio>
#include <cuda.h>
__global__ void hello()
{
printf("Hello!
");
}
using:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.o defines.o
When I try to run output a.out file using:
optirun ./a.out
I get no "Hello!" in console. What can be the problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…