Reputation: 2685
I'm trying to run TensorFlow on my integrated Intel GPU on machine that has both integrated and discrete graphic card.
user@host:~$ lscpu | grep "Model name"
Model name: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
When I'm running TensorFlow's script to check list of devices
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos]
print(get_available_gpus())
I'm getting following result
18:30:21.335442: E tensorflow/stream_executor/cuda/cuda_driver.cc:397] failed call to cuInit: CUDA_ERROR_UNKNOWN
18:30:21.335465: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:145] kernel driver does not appear to be running on this host (host): /proc/driver/nvidia/version does not exist
['/device:CPU:0', '/device:XLA_CPU:0', '/device:XLA_GPU:0']
I suppose this might be related to some problem with OpenCL, because when I'm running clinfo I'm getting
user@host:~$ clinfo
Number of platforms 0
user@host:~$ ls /etc/OpenCL/vendors/
intel.icd nvidia.icd
Another thing is that when I run some sample testing application I found online
#include "CL/cl.h"
#include <stdio.h>
int main()
{
cl_platform_id pid;
cl_uint num;
cl_uint n=1;
cl_int error=clGetPlatformIDs(1,&pid,&num);
printf("Error code= %d\nNo. of platforms= %d",error,num);
getchar();
}
I'm getting error code -1001 and 0 platforms. As I found out this might mean I need to install drivers, but as I understand looking at /etc/OpenCL/vendors/
I already have them installed.
In PRIME Profiles I have
user@host:~$ sudo prime-select query
[sudo] password for user:
intel
Switching to nvidia clinfo is working properly as well TensorFlow.
I'm running Ubuntu 18.04 LTS
user@host:~$ uname -a
Linux host 4.15.0-30-generic #32-Ubuntu SMP Thu Jul 26 17:42:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Additional info I think might be helpful in debugging is that I'm working on this machine remotely without any display connected directly.
I'd really appreciate any suggestion what I'm missing here to fix TensorFlow and clinfo issue.
Upvotes: 3
Views: 5893
Reputation: 9
First of all please check the CUDA and cuDNN version you are using is correct or not, FROM:- https://www.tensorflow.org/install/source for your corresponding OS and TF version.
IF that's correct then do check if you are using tensorflow-gpu not tensorflow-cpu.
Also I suggest you to work with the discrete GPU that you have on your machine instead of the integrated one.
Here's a link that might help Issue as mentioned above
Upvotes: 1