Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:04:21+00:00 2026-06-14T04:04:21+00:00

I wrote the following simple CUDA kernel: __global__ void pr_kernel(float* O, const float* I,

  • 0

I wrote the following simple CUDA kernel:

__global__ void pr_kernel(float* O, const float* I, const float* W, int N)
{
  int x = threadIdx.x;
  float sum;
  int i;
  if (x < N) {
    for (i = 0; i < N; i++) {
      if (i == x) continue;
      sum += W[x*N+i] * I[x];
    }
    O[x] = (0.15 / N) + 0.85 * sum;
  }
}

The variables are allocated in Python as follows:

N      = np.int32(4)
W      = np.float32(np.asarray(
         [0, 1, 0, 1, 1, 0, 1, 1, 
         0, 1, 0, 1,1, 1, 0]))
I      = np.float32(np.asarray(
         [0.25, 0.25, 0.25, 0.25]))
O      = np.float32(np.zeros(N))

I’m transferring the variables using gpuarray.to_gpu, and I’m calling the kernel on a Tesla C2070 with the following line:

pr_kernel(O_d, I_d, W_d, N_d, block=blocksize, grid=gridsize)

Where:

blocksize = (128, 1, 1)
gridsize = (1, 1)

I get the error message:

pycuda.driver.LaunchError: cuLaunchKernel failed: launch out of resources.

This happens even if I reduce blocksize to something like (8, 1, 1). I can run other CUDA programs on the GPU with a blocksize of (512, 1, 1) so I’m confident this is not due to a GPU configuration issue.

What am I doing wrong? Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:04:23+00:00Added an answer on June 14, 2026 at 4:04 am

    The problem was that I was transferring the integer N to the GPU using gpuarray.to_gpu, where I should have been directly passing N to the pr_kernel function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a simple experiment, I wrote the following code in Xcode: int main(int
In Visual C++ i wrote the following sample in a C++ program: float f1
I wrote following function void validateUser(void) { string uName; string uPassword; char c; map
I wrote the following simple function that takes two parameters mostly coming from another
all. I wrote the following simple code to test scala.actors._: // java version 1.7.0_02
I wrote the following Perl script (below) in order to create simple XML file.
I have wrote following code for a simple problem in Python - def Peu1(numbers):
I'm learning sml, and wrote the following simple function: (* Return a list with
I wrote the following jQuery plugin that is basically just a simple notification system
I needed some simple string encryption, so I wrote the following code (with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.