I have the same issue on Ubuntu 14.01 (able to train on GPU with Python API, but can’t in c++ API). I’m following the tutorial here: https://pytorch.org/tutorials/advanced/cpp_export.html 10. Any idea what I’m doing wrong?
Ubuntu: 14.01
gcc: 4.8.4
ldd: 2.19
Python: 3.6
Cuda: 10.0
Nvidia Driver: 410.78
Pytorch: https://download.pytorch.org/whl/cu100/torch-1.3.0%2Bcu100-cp36-cp36m-linux_x86_64.whl
Libtorch: https://download.pytorch.org/libtorch/cu100/libtorch-shared-with-deps-1.3.0.zip

When I run:
cmake -DCMAKE_PREFIX_PATH=/home/bfortuner/libtorch ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
...

-- Found CUDA: /usr/local/cuda-10.0 (found version "10.0") 
-- Caffe2: CUDA detected: 10.0
-- Caffe2: CUDA nvcc is: /usr/local/cuda-10.0/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-10.0
-- Caffe2: Header version is: 10.0
-- Found CUDNN: /usr/lib/x86_64-linux-gnu/libcudnn.so  
-- Found cuDNN: v7.4.1 (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Autodetected CUDA architecture(s): 6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Found torch: /home/bfortuner/libtorch/lib/libtorch.so  

But when try to load the model, it says:
CUDA driver version is insufficient for CUDA runtime version
But my CUDA/driver are compatible when I use the python API?
If I skip the model load and run torch::cuda::is_available(), I get false.
I’m sure there’s something simple I’m missing?