Ok tested with the above two steps and both of them doesn’t seem to work . I am guessing my CPU and GPU are throttling and then it stalls the process causing the hang?
Below is the nvdia-smi output when its stalled :
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070   WDDM  | 00000000:01:00.0  On |                  N/A |
| N/A   73C    P2    39W /  N/A |   3232MiB /  8192MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      8820    C+G   ...osoft.LockApp_cw5n1h2txyewy\LockApp.exe N/A      |
|    0      9412    C+G   Insufficient Permissions                   N/A      |
|    0      9784      C   ...\admin\Miniconda3\envs\torch\python.exe N/A      |
|    0     10956    C+G   C:\Windows\explorer.exe                    N/A      |
|    0     11460    C+G   ...6)\Google\Chrome\Application\chrome.exe N/A      |
|    0     12316    C+G   ...cal\Programs\Microsoft VS Code\Code.exe N/A      |
|    0     13632    C+G   ...hell.Experiences.TextInput.InputApp.exe N/A      |
|    0     16728    C+G   ...oftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe N/A      |
|    0     17108    C+G   ...DIA GeForce Experience\NVIDIA Share.exe N/A      |
|    0     17696    C+G   Insufficient Permissions                   N/A      |
|    0     17884    C+G   ....95.0_x64__kzf8qxf38zg5c\Skype4Life.exe N/A      |
|    0     19344    C+G   ...t_cw5n1h2txyewy\ShellExperienceHost.exe N/A      |
|    0     19508    C+G   ...dows.Cortana_cw5n1h2txyewy\SearchUI.exe N/A      |
|    0     21836    C+G   Insufficient Permissions                   N/A      |
|    0     24484    C+G   ...x64__8wekyb3d8bbwe\Microsoft.Photos.exe N/A      |
+-----------------------------------------------------------------------------+


and when I press any key event :
| NVIDIA-SMI 436.48       Driver Version: 436.48       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070   WDDM  | 00000000:01:00.0  On |                  N/A |
| N/A   90C    P2    58W /  N/A |   3244MiB /  8192MiB |     97%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      8820    C+G   ...osoft.LockApp_cw5n1h2txyewy\LockApp.exe N/A      |
|    0      9412    C+G   Insufficient Permissions                   N/A      |
|    0      9784      C   ...\admin\Miniconda3\envs\torch\python.exe N/A      |
|    0     10956    C+G   C:\Windows\explorer.exe                    N/A      |
|    0     11460    C+G   ...6)\Google\Chrome\Application\chrome.exe N/A      |
|    0     12316    C+G   ...cal\Programs\Microsoft VS Code\Code.exe N/A      |
|    0     13632    C+G   ...hell.Experiences.TextInput.InputApp.exe N/A      |
|    0     16728    C+G   ...oftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe N/A      |
|    0     17108    C+G   ...DIA GeForce Experience\NVIDIA Share.exe N/A      |
|    0     17696    C+G   Insufficient Permissions                   N/A      |
|    0     17884    C+G   ....95.0_x64__kzf8qxf38zg5c\Skype4Life.exe N/A      |
|    0     19344    C+G   ...t_cw5n1h2txyewy\ShellExperienceHost.exe N/A      |
|    0     19508    C+G   ...dows.Cortana_cw5n1h2txyewy\SearchUI.exe N/A      |
|    0     21836    C+G   Insufficient Permissions                   N/A      |
|    0     24484    C+G   ...x64__8wekyb3d8bbwe\Microsoft.Photos.exe N/A      |
+-----------------------------------------------------------------------------+