Code Monkey home page Code Monkey logo

Comments (6)

akj10 avatar akj10 commented on July 4, 2024

Try commenting out cudaGetDevice, cudaSetDevice, cudaStreamCreate calls from the app?
If you try the BFS from Rodinia 3.1, it works.

from gpgpu-sim_distribution.

mahmoodn avatar mahmoodn commented on July 4, 2024

Actually, it is more than simple device checking. Looking at part of the init process (here), such device information are used to determine the streams and other thing to run on gpu.

Isn't possible for gpgpusim to return a device for cudaGetDevice()?

from gpgpu-sim_distribution.

topcuburak avatar topcuburak commented on July 4, 2024

Hello Mahmood,

Could you run the deviceQuery for the GPGPU-sim 3.0 or 4.0 to get the properties of the simulator? If you could (I hope so), can you share with me? I cannot go beyond the below log. Best wishes.

./deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 100
-> no CUDA-capable device is detected
Result = FAIL

from gpgpu-sim_distribution.

onnx-bsd avatar onnx-bsd commented on July 4, 2024

Hi topcuburak

I am also facing same problem. All application compiling but while running it is not finding any CUDA enabled device.

from gpgpu-sim_distribution.

mahmoodn avatar mahmoodn commented on July 4, 2024

The topic is old, really. I suggest you to test the latest version.

from gpgpu-sim_distribution.

debtanu09 avatar debtanu09 commented on July 4, 2024

Hi I'm getting the output-

Iterate 10 times with GPU 0 or CPU 1: 0
test 4
ERROR: no CUDA-capable device is detected

I'm a absolute beginner in CUDA and GPGPU-SIM (started yesterday)
Can someone please help.

I'm trying the following code -
#include <cuda_runtime.h>
#include <cuda.h>
#include <stdio.h>
#include <sys/time.h>
#include <math.h>

#define N 32

global void Kernel_double(int niters, int* d_inputs,double* d_outputs)
{
int tid = blockIdx.x * blockDim.x + threadIdx.x;

if (tid<N) {
double val =(double) d_inputs[tid];
/*for (int iter=0; iter < niters; iter++){
val = (sqrt(pow(val,2.0)) + 5.0) - 101.0;
val = (val / 3.0) + 102.0;
val = (val + 1.07) - 103.0;
val = (val / 1.037) + 104.0;
val = (val + 3.00) - 105.0;
val = (val / 0.22) + 106.0;
}*/
val = val + 1.0;
//printf("This is %f\n",val);
d_outputs[tid] = val;

}
}

int main(int argc, char **argv)
{

int niters = 10;
int cpu = 0;
printf("Iterate %d times with GPU 0 or CPU 1: %d\n", niters, cpu);

int inputs[N];
for (int i = 0; i<N; i++){
inputs[i] = i+1;
}

int *d_inputs;
double *d_outputs;
double outputs[N];

cudaMalloc( (void**)&d_inputs, N*sizeof(int));
cudaMalloc( (void**)&d_outputs, N*sizeof(double));
printf("test %d \n", inputs[3]);
cudaMemcpy(d_inputs, inputs, N*sizeof(int), cudaMemcpyHostToDevice);

// printf("test %d \n", d_inputs[1]);
Kernel_double<<<16,2>>>(niters, d_inputs,d_outputs);
cudaDeviceSynchronize();
cudaError_t error = cudaGetLastError();
if(error!=cudaSuccess)
{
fprintf(stderr,"ERROR: %s\n", cudaGetErrorString(error) );
exit(-1);
}
//cudaDeviceSynchronize();
cudaMemcpy(outputs, d_outputs, N*sizeof(double), cudaMemcpyDeviceToHost);
for(int j =0;j<10; j++){
printf("Outputs[%d] is: %f\n",j, outputs[j]);
}
cudaFree(d_inputs);
cudaFree(d_outputs);

return EXIT_SUCCESS;

}

I have nvcc 11.2
gcc 10.2
I'm using the latest GPGPU Sim

from gpgpu-sim_distribution.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.