CUPTI compatibility issue
Hi, I'm running CUDA-5.5 on Ubuntu 16.04 x86_64 with GeForce GTX 1060, driver version 384.90. I had correctly configured them, demo building & running success. Now I'm trying to evaluate my program with the following code: [code] char *m_deviceName = (char*)malloc(1024); DRIVER_API_CALL(cuDeviceGetName(m_deviceName, 1023, m_device)); printf("Using device: %s\n", m_deviceName); free(m_deviceName); DRIVER_API_CALL(cuCtxCreate(&m_context, 0, m_device)); CUPTI_CALL(cuptiSubscribe(&m_subscriber,(CUpti_CallbackFunc)detail::get_value_callback, &m_kernel_data)); CUPTI_CALL(cuptiEnableCallback(1, m_subscriber,CUPTI_CB_DOMAIN_RUNTIME_API, CUPTI_RUNTIME_TRACE_CBID_cudaLaunch_v3020)); uint32_t avame=0; CUPTI_CALL(cuptiDeviceGetNumMetrics(m_device, &avame)); std::cout<<"Available metrics: "<<avame<<std::endl; [/code] It prints: [code] Using device: GeForce GTX 1060 6GB ../include/cupti_profiler.h:367: error: function cuptiDeviceGetNumMetrics(m_device, &avame) failed with error CUPTI_ERROR_INVALID_DEVICE. [/code] Line number 367 is refereed to line 11. I'm wondering why I can detect my device but can't get metric numbers. CUPTI compatibility issues? I would be grateful for any advice!
Hi, I'm running CUDA-5.5 on Ubuntu 16.04 x86_64 with GeForce GTX 1060, driver version 384.90. I had correctly configured them, demo building & running success. Now I'm trying to evaluate my program with the following code:

char *m_deviceName = (char*)malloc(1024);
DRIVER_API_CALL(cuDeviceGetName(m_deviceName, 1023, m_device));
printf("Using device: %s\n", m_deviceName);
free(m_deviceName);

DRIVER_API_CALL(cuCtxCreate(&m_context, 0, m_device));
CUPTI_CALL(cuptiSubscribe(&m_subscriber,(CUpti_CallbackFunc)detail::get_value_callback, &m_kernel_data));
CUPTI_CALL(cuptiEnableCallback(1, m_subscriber,CUPTI_CB_DOMAIN_RUNTIME_API, CUPTI_RUNTIME_TRACE_CBID_cudaLaunch_v3020));

uint32_t avame=0;
CUPTI_CALL(cuptiDeviceGetNumMetrics(m_device, &avame));
std::cout<<"Available metrics: "<<avame<<std::endl;


It prints:
Using device: GeForce GTX 1060 6GB
../include/cupti_profiler.h:367: error: function cuptiDeviceGetNumMetrics(m_device, &avame) failed with error CUPTI_ERROR_INVALID_DEVICE.


Line number 367 is refereed to line 11.

I'm wondering why I can detect my device but can't get metric numbers.
CUPTI compatibility issues?

I would be grateful for any advice!

#1
Posted 11/14/2017 04:21 PM   
CUDA 5.5 predates your hardware, the GTX 1060, by many years. You would want to install the currently shipping version of CUDA (version 9), or at minimum CUDA 8.0.
CUDA 5.5 predates your hardware, the GTX 1060, by many years. You would want to install the currently shipping version of CUDA (version 9), or at minimum CUDA 8.0.

#2
Posted 11/14/2017 04:54 PM   
I solved the problem by switching CUDA to version 9.0. Thanks again.
I solved the problem by switching CUDA to version 9.0. Thanks again.

#3
Posted 11/14/2017 05:34 PM   
But it will not run on computers with NVidia drivers released before CUDA 9.0. What is the best practice to support the widest possible range of drivers? I only know two ways: compiling with old CUDA (like 6.0) or package app in multiple builds - compiled with different CUDA versions, but this looks very inconvenient. P.S. The problem is not imaginary, because at least users with notebooks don't always have the possibility to update driver to the last one. P.P.S. Approximate table of correspondence between CUDA SDK and minimum driver required you can see [url=https://stackoverflow.com/questions/30820513/what-is-version-of-cuda-for-nvidia-304-125/30820690#30820690]here[/url].
But it will not run on computers with NVidia drivers released before CUDA 9.0. What is the best practice to support the widest possible range of drivers? I only know two ways: compiling with old CUDA (like 6.0) or package app in multiple builds - compiled with different CUDA versions, but this looks very inconvenient.

P.S. The problem is not imaginary, because at least users with notebooks don't always have the possibility to update driver to the last one.

P.P.S. Approximate table of correspondence between CUDA SDK and minimum driver required you can see here.

#4
Posted 11/15/2017 10:56 AM   
A general purpose CUDA app shouldn't require CUPTI. Your strategy is reasonable for general purpose apps. And furthermore nothing was debugged or root caused here. The suggestion was to get the user going with a minimum of effort. And, unfortunately, there have been some issues along the way which will prevent some general purpose apps from running on newer hardware. For example apps built using pre-cuda 8.0 CURAND. So, the best strategy is not to rely on the stated intent of CUDA compatibility, but to actually QA test your production programs, which is good practice for any software development effort. It may be necessary to issue new/updated versions of your software as the years go by.
A general purpose CUDA app shouldn't require CUPTI. Your strategy is reasonable for general purpose apps. And furthermore nothing was debugged or root caused here. The suggestion was to get the user going with a minimum of effort.

And, unfortunately, there have been some issues along the way which will prevent some general purpose apps from running on newer hardware. For example apps built using pre-cuda 8.0 CURAND. So, the best strategy is not to rely on the stated intent of CUDA compatibility, but to actually QA test your production programs, which is good practice for any software development effort. It may be necessary to issue new/updated versions of your software as the years go by.

#5
Posted 11/15/2017 03:40 PM   
I think I was wrong when I asked my question in this topic, my case doesn't use CUPTI or CURAND, this discussion triggered my question and it will be better if I will create another topic. :)
I think I was wrong when I asked my question in this topic, my case doesn't use CUPTI or CURAND, this discussion triggered my question and it will be better if I will create another topic. :)

#6
Posted 11/15/2017 03:48 PM   
Scroll To Top

Add Reply