# No GPU devices in Session

**URL:** <https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093>\
**Category:** CUPTI – CUDA Profiler Tools Interface\
**Tags:** cuda\
**Created:** [August 2, 2020, 8:25pm UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093 "2020-08-02T20:25:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![g\_papaioannou](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/g_papaioannou/32/103102_2.png) [@g\_papaioannou](https://forums.developer.nvidia.com/u/g_papaioannou)\
**Post date:** [August 2, 2020, 8:25pm UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/1 "2020-08-02T20:25:49Z")

</div>

Just new in CUDA, so excuse any mistakes or misunderstandings.

I am trying to profile a simple C++ program from the book “Learn CUDA Programming” in chapter2 you can find in the link below.

> **[Learn-CUDA-Programming/Chapter02/02\_memory\_overview/03\_aos\_soa at master ·...](https://github.com/PacktPublishing/Learn-CUDA-Programming/tree/master/Chapter02/02_memory_overview/03_aos_soa)**
>
> Learn CUDA Programming, published by Packt. Contribute to PacktPublishing/Learn-CUDA-Programming development by creating an account on GitHub.

Running the Visual Profiler, in the “Overall GPU usage” tab, I get “No GPU devices in Session”, which means I far as I can understand that no GPU’s were used.

My laptop Asus has two video cards. One integrated (Intel) and another one, Nvidia GTX 960M.

I suspected that the visual profiler is using the integrated video card, so I changed the default video card for this specific application, under the “Nvidia Control Panel” and “Manager 3d Settings-\>Program Settings” to use the “High-Performance NVidia Processor”.

Nothing changed. Also, I noticed that the Nvidia display icon in the notification area is not reporting any applications that are using the video card.

What seems to be the problem here? How can I enable also the Nvidia GPU for both Visual Profiler and the command line nvprof.exe application?

Best Regards,

PS: I installed CUDA Version 11

```
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Thu_Jun_11_22:26:48_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.0, V11.0.194
Build cuda_11.0_bu.relgpu_drvr445TC445_37.28540450_0

```

---

<div class="post-metadata">

**Author:** ![Sanjiv.Satoor](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sanjiv.satoor/32/14043_2.png) [@Sanjiv.Satoor](https://forums.developer.nvidia.com/u/Sanjiv.Satoor)\
**Post date:** [August 3, 2020, 10:40am UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/2 "2020-08-03T10:40:26Z")

</div>

What is the OS version?  
Is the NVIDIA driver correctly installed?  
Did you install the driver as part of the CUDA 11 installation?  
Please check the driver version under NVIDIA Control Panel “Help-\>System Information”.

---

<div class="post-metadata">

**Author:** ![g\_papaioannou](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/g_papaioannou/32/103102_2.png) [@g\_papaioannou](https://forums.developer.nvidia.com/u/g_papaioannou)\
**Post date:** [August 3, 2020, 2:08pm UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/3 "2020-08-03T14:08:36Z")

</div>

Hi

My OS is win10 64bit. Everything works just fine except this. Cuda SDK updated my video card driver since it was a little bit older.

I have changed successfully other app’s video card under the Nvidia control panel, but visual and cli profilers do not seem to take in account this. Is there any chance that are pretty old to recognize multiple video cards?

I have installed also insight but I didn’t test it yet, but I am pretty sure that it will work. I will give it a try layer.

In this case, I just want to follow the book instructions with these specific tools.

Regards,

Edited: Take a look to the images attached. It seems neither Nsight works for me.

 ![NSight_No_Kernels](https://global.discourse-cdn.com/nvidia/original/3X/d/8/d8fe06a94071dc0de187107cc2ba474639ed6145.jpeg)

---

<div class="post-metadata">

**Author:** ![Sanjiv.Satoor](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sanjiv.satoor/32/14043_2.png) [@Sanjiv.Satoor](https://forums.developer.nvidia.com/u/Sanjiv.Satoor)\
**Post date:** [August 4, 2020, 11:03am UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/4 "2020-08-04T11:03:35Z")

</div>

1. You mentioned:  
"I changed the default video card for this specific application, under the “Nvidia Control Panel” and “Manager 3d Settings-\>Program Settings” to use the “High-Performance NVidia Processor”.  
These control panel settings are not required for using nvprof or Visual Profiler.

2. Can you please confirm that you can run the same CUDA applications standalone successfully (without any profiler)?

3. You mentioned:  
“Running the Visual Profiler, in the “Overall GPU usage” tab, I get “No GPU devices in Session”, which means I far as I can understand that no GPU’s were used.”  
Could you see the timeline view in Visual Profiler?  
It will be best to first try and check if nvprof works.

4. Note that the GPU you have Nvidia GTX 960M is a Maxwell architecture GPU and it is not supported by Nsight Compute. Please refer the Nsight Compute document - [Release Notes :: Nsight Compute Documentation](https://docs.nvidia.com/nsight-compute/ReleaseNotes/index.html#gpu-support)

---

<div class="post-metadata">

**Author:** ![g\_papaioannou](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/g_papaioannou/32/103102_2.png) [@g\_papaioannou](https://forums.developer.nvidia.com/u/g_papaioannou)\
**Post date:** [August 4, 2020, 1:27pm UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/5 "2020-08-04T13:27:38Z")

</div>

thanks,

1. Ok, I thought that it may be an activation of the high-performance video card problem.
2. Yes, I can confirm that the application at the link below (aos.cu and soa.cu ) runs successfully without any errors.  
[Learn-CUDA-Programming/Chapter02/02\_memory\_overview/03\_aos\_soa at master · PacktPublishing/Learn-CUDA-Programming · GitHub](https://github.com/PacktPublishing/Learn-CUDA-Programming/tree/master/Chapter02/02_memory_overview/03_aos_soa)  
3)Yes I can see the timeline in the Visual Profiler  
 ![Visual Profiler No GPUs](https://global.discourse-cdn.com/nvidia/original/3X/7/1/717b090ec795fe6642f9f70779183462c2b23b17.jpeg)  
The CLI nvprof reports “No kernels were profiled.” but it shows some statistics like those below.  
[nvprof — ImgBB](https://ibb.co/26Nsd8X)

1. Didn’t know this, I am sorry. I will check it.

---

<div class="post-metadata">

**Author:** ![rameshgunjal](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/rameshgunjal/32/14043_2.png) [@rameshgunjal](https://forums.developer.nvidia.com/u/rameshgunjal)\
**Post date:** [August 6, 2020, 9:30am UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/6 "2020-08-06T09:30:10Z")

</div>

Hi,

I looked at the source code you pointed out  
[https://github.com/PacktPublishing/Learn-CUDA-Programming/tree/master/Chapter02/02\_memory\_overview/03\_aos\_soa](https://github.com/PacktPublishing/Learn-CUDA-Programming/tree/master/Chapter02/02_memory_overview/03_aos_soa)

I can see that makefile builds two executable - “aos\_soa” and “aos\_soa\_solved” but I cannot see corresponding files in the directory. The listed source files are “aos.cu” and “soa.cu”. From your screen-shot it seems you ran aos\_soa.exe. Did you make any changes to the github original code to build aos\_soa.exe?

I tried building “aos.cu” and “soa.cu” at my end and profiled both executable in nvvp/nvprof. It works perfectly fine for me.

Here is nvprof output, You can see one kernel profiled

```
$ nvprof ./aos
==14494== NVPROF is profiling process 14494, command: ./aos
==14494== Profiling application: ./aos
==14494== Profiling result:
            Type Time(%) Time Calls Avg Min Max Name
GPU activities: 100.00% 114.72us 1 114.72us 114.72us 114.72us complicatedCalculation(Coefficients_AOS*)
      API calls: 99.23% 202.92ms 1 202.92ms 202.92ms 202.92ms cudaMalloc
                    0.38% 786.05us 100 7.8600us 278ns 487.64us cuDeviceGetAttribute
                    0.24% 483.75us 1 483.75us 483.75us 483.75us cuDeviceTotalMem

```

However there are few reasons when nvprof result in “No kernels were profiled” situation. Can you please try few things and see if you get the kernel result.

Make an explicit synchronization call cudaDeviceSynchronize() after your kernel launch before freeing up device memory. e.g.

```
complicatedCalculation<<<num_blocks,NUM_THREADS>>>(d_x);
cudaDeviceSynchronize();

```

OR

Call nvprof with flag `--unified-memory-profiling off`  
e.g. `> nvprof --unified-memory-profiling off ./aos`

---

<div class="post-metadata">

**Author:** ![g\_papaioannou](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/g_papaioannou/32/103102_2.png) [@g\_papaioannou](https://forums.developer.nvidia.com/u/g_papaioannou)\
**Post date:** [August 6, 2020, 1:27pm UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/7 "2020-08-06T13:27:50Z")

</div>

Problem solved. As a beginner in the CUDA world, I didn’t know that I should add the parameter _gencode_ to compile my CUDA files under the command line (Visual Studio of CUDA SDK sample projects are already had these parameters that’s why I had GPU activity).

So, the full parameter list under the command line should be like this for my maxwell architecture with CUDA Capability Major/Minor version number 5.0.

`nvcc -run -m64 -gencode arch=compute_50,code=sm_50 -o aos_soa.exe aos_soa.cu`

Unfortunately, my 1st book “_Learn CUDA Programming_”, from Packt Publishing, on page 49 refers that I should compile ONLY with the following parameters, besides the fact that in the source code files is contains a “Makefile” that includes all of the parameters above (only for linux, so I ignored it).

`$ nvcc -o aos_soa ./aos_soa.cu`  
Now I can see my GPU statistics under **nvprof**.

```
nvcc -run -m64 -gencode arch=compute_50,code=sm_50 -o aos_soa.exe aos_soa.cu

nvprof aos_soa.exe
==18308== NVPROF is profiling process 18308, command: aos_soa.exe
==18308== Profiling application: aos_soa.exe
==18308== Profiling result:
            Type Time(%) Time Calls Avg Min Max Name
 GPU activities: 100.00% 1.1421ms 1 1.1421ms 1.1421ms 1.1421ms complicatedCalculation(Coefficients_SOA*)
      API calls: 83.40% 226.57ms 1 226.57ms 226.57ms 226.57ms cudaMalloc
                   15.90% 43.183ms 1 43.183ms 43.183ms 43.183ms cuDevicePrimaryCtxRelease
                    0.58% 1.5790ms 1 1.5790ms 1.5790ms 1.5790ms cudaFree
                    0.07% 198.40us 1 198.40us 198.40us 198.40us cuModuleUnload
                    0.03% 70.100us 1 70.100us 70.100us 70.100us cudaLaunchKernel
                    0.01% 26.800us 1 26.800us 26.800us 26.800us cuDeviceTotalMem
                    0.01% 20.200us 101 200ns 100ns 3.3000us cuDeviceGetAttribute
                    0.00% 11.600us 1 11.600us 11.600us 11.600us cuDeviceGetPCIBusId
                    0.00% 1.4000us 3 466ns 200ns 700ns cuDeviceGetCount
                    0.00% 1.4000us 2 700ns 200ns 1.2000us cuDeviceGet
                    0.00% 600ns 1 600ns 600ns 600ns cuDeviceGetName
                    0.00% 400ns 1 400ns 400ns 400ns cuDeviceGetLuid
                    0.00% 300ns 1 300ns 300ns 300ns cuDeviceGetUuid

```

Best Regards,

PS : @ rameshgunjal, What video card do you have? I see a huge speedup in our GPU metric results.

---

<div class="post-metadata">

**Author:** ![rameshgunjal](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/rameshgunjal/32/14043_2.png) [@rameshgunjal](https://forums.developer.nvidia.com/u/rameshgunjal)\
**Post date:** [August 6, 2020, 2:27pm UTC](https://forums.developer.nvidia.com/t/no-gpu-devices-in-session/145093/8 "2020-08-06T14:27:40Z")

</div>

Good to know that your problem is solved.

I use GEFORCE RTX 2080 Ti (compute capability 7.5)

–  
Thanks,  
Ramesh
