CUDA error: no kernel image is available for execution on the device Error from operator

Hi all,

I compiled whole pythorch with GPU support and console output was successfully compiled. Therefore I was able to get caffe2_pybind11_state.pyd and caffe2_pybind11_state_gpu.pyd.

When I run python the following code without GPU support it succeeds:
python char_rnn.py --train_data shakespeare.txt

However, when I run it with GPU I got a CUDA error:
python char_rnn.py --train_data shakespeare.txt --gpu

Below my configuration
PyTorch or Caffe2: Caffe2
How you installed PyTorch (conda, pip, source): github
OS: Windows 10
PyTorch version: current version
Python version: 2.7
CUDA/cuDNN version: 9.2/7.1
GPU models and configuration: NVIDIA GeForce GTX 1050
CMake version: cmake-3.12.0-rc2-win64-x64.msi
Versions of any other relevant libraries: Visual Studio 2017

Do I need to change from CUDA 9.2 to CUDA 8.0 in order to solve the issue? Do I need to use also Visual Studio 2015 instead? Thanks in advance!

Output from console:
D:\Yeverino\git_projects\pytorch\caffe2\python\examples>python char_rnn.py --train_data shakespeare.txt --gpu
[E D:\Yeverino\git_projects\pytorch\caffe2\core\init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E D:\Yeverino\git_projects\pytorch\caffe2\core\init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E D:\Yeverino\git_projects\pytorch\caffe2\core\init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Input has 62 characters. Total input size: 99993
DEBUG:char_rnn:Start training
DEBUG:char_rnn:Training model
WARNING:caffe2.python.workspace:Original python traceback for operator 0 in network char_rnn_init in exception above (most recent call last):
WARNING:caffe2.python.workspace: File “char_rnn.py”, line 276, in
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\utils.py”, line 329, in wrapper
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\utils.py”, line 291, in run
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\utils.py”, line 328, in func
WARNING:caffe2.python.workspace: File “char_rnn.py”, line 270, in main
WARNING:caffe2.python.workspace: File “char_rnn.py”, line 71, in CreateModel
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\rnn_cell.py”, line 1571, in _LSTM
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\rnn_cell.py”, line 93, in apply_over_sequence
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\rnn_cell.py”, line 491, in prepare_input
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\brew.py”, line 107, in scope_wrapper
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\helpers\fc.py”, line 58, in fc
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\helpers\fc.py”, line 37, in _FC_or_packed_FC
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\model_helper.py”, line 214, in create_param
WARNING:caffe2.python.workspace: File “D:\Yeverino\git_projects\pytorch\build\caffe2\python\modeling\initializers.py”, line 30, in create_param
Entering interactive debugger. Type “bt” to print the full stacktrace. Type “help” to see command listing.
[enforce fail at context_gpu.h:171] . Encountered CUDA error: no kernel image is available for execution on the device Error from operator:
output: “LSTM/i2h_w” name: “” type: “XavierFill” arg { name: “shape” ints: 400 ints: 62 } device_option { device_type: 1 cuda_gpu_id: 0 }

d:\yeverino\git_projects\pytorch\build\caffe2\python\workspace.py(178)CallWithExceptionIntercept()
→ return func(*args, **kwargs)
(Pdb)