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

  • SEARCH
  • Home
  • 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 6092057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:23:56+00:00 2026-05-23T12:23:56+00:00

I have a kernel which runs twice with different grid size. My problem is

  • 0

I have a kernel which runs twice with different grid size.

My problem is with cuPrintf. When I don’t have cudaPrintfInit() before kernel run and cudaPrintfDisplay(stdout, true) and cudaPrintfEnd() after kernel run, I have no error but when I put them there I get “unspecified launch failure” error.

In my device code, there is only one loop like this for printing:

if (threadIdx.x==0) {
     cuPrintf("MAX:%f x:%d y:%d\n", maxVal, blockIdx.x, blockIdx.y);
}

I’m using CUDA 4.0 with a card with cuda capability 2.0 and so I’m compiling my code with this syntax:

nvcc LB2.0.cu -arch=compute_20 -code=sm_20  
  • 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-05-23T12:23:57+00:00Added an answer on May 23, 2026 at 12:23 pm

    If you are on a CC 2.0 GPU, you don’t need cuPrintf at all — CUDA has printf built-in for CC-2.0 and higher GPUs. So just replace your call to cuPrintf with this:

    #if __CUDA_ARCH__ >= 200
    if (threadIdx.x==0) {
        printf("MAX:%f x:%d y:%d\n", maxVal, blockIdx.x, blockIdx.y);
    }
    #endif
    

    (Note you only need the #if / #endif lines if you are compiling your code for sm_20 and also earlier versions. With the example compilation command line you gave, you can eliminate them.)

    With printf, you don’t need cudaPrintfInit() or cudaPrintfDisplay() — it is automatic. However if you print a lot of data, you may need to increase the default printf FIFO size with cudaDeviceSetLimit(), passing the cudaLimitPrintfFifoSize option.

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

Sidebar

Related Questions

I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19.
I have an application that runs on embedded linux (older kernel, 2.6.18). I'm using
I have a Linux kernel module M1 which exports a symbol S1 . When
I have a kernel module in which I deal with USB devices. It happens
I have a CUDA kernel which I'm compiling to a cubin file without any
I got application which runs on rails 2.3.11. I have created a separate gem
I have a buggy kernel module which I am trying to fix. Basically when
I have written a kernel module which reads and writes /proc files, and it
I have a main kernel module with which other kernel modules communicate. I have
I have a kernel module that provides data to a userland process through read().

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.