Finally I solved!
This post
Ubuntu 16.04, Theano and Cuda
suggests to add flag
nvcc.flags=-D_FORCE_INLINES
to command line, so the command line becomes:
THEANO_FLAGS=floatX=float32,device=gpu,nvcc.flags=-D_FORCE_INLINES python check1.py
It seems to fix a bug in using glibc 2.23
fix for glibc 2.23
Now the program uses correctly the GPU, this is the correct output:
THEANO_FLAGS=floatX=float32,device=gpu,nvcc.flags=-D_FORCE_INLINES python check1.py
Using gpu device 0: GeForce GTX 750 Ti (CNMeM is disabled, cuDNN not available)
[GpuElemwise{exp,no_inplace}(<CudaNdarrayType(float32, vector)>), HostFromGpu(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.317012 seconds
Result is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761
1.62323296]
Used the gpu
Note that before trying this solution, I removed nvidia-cuda-toolkit and installed CUDA from Nvidia website, following part of instructions found here:
CUDA with Ubuntu 16.04
This is what exactly I did:
1) I downloaded CUDA from here
CUDA 7.5 download
selecting LINUX, x86_64, Ubuntu 15.04, deb local
2) I installed the deb file
dpkg -i cuda_repo-ubuntu1504-7-5-local_7.5-18_amd64.deb
3) Then run
apt-get update
This gives some errors! I fixed it overwriting the file Release in \var\cuda-repo-7.5-local with the following lines:
Origin: NVIDIA
Label: NVIDIA CUDA
Architecture: repogenstagetemp
MD5Sum:
51483bc34577facd49f0fbc8c396aea0 75379 Packages
4ef963dfa4276be01db8e7bf7d8a4f12 21448 Packages.gz
SHA256:
532b1bb3b392b9083de4445dab2639b36865d7df1f610aeef8961a3c6f304d8a 75379 Packages
2e48cc13b6cc5856c9c6f628c6fe8088ef62ed664e9e0046fc72819269f7432c 21448 Packages.gz
(sorry, I do not remember where I read this solution).
4) I succesfully run
apt-get-update
apt-get install cuda
5) Everything was insatlled in \usr\local\cuda-7.5
6) I commented the line n 115 in file \usr\local\cuda-7.5\include\host-config.h
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9)
//#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
#endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9) */
which seems to prevent CUDA from using gcc 5.4
After all these operations, I updated the .theanorc file, adding the cuda root
[cuda]
root = /usr/local/cuda-7.5
That's all :)
PS: I do not know if it would work even with nvidia-cuda-toolkit!
We also encountered this problem where lower-versioned DLLs were not getting reinstalled on a major upgrade. I thought it was strange that the installer would decide which files to install based on the versioning of existing files, then completely uninstall everything, but still only install what what files had been determined to install before uninstalling the old product. This seems like it might be a bug in Windows Installer...
To fix this problem we moved the RemoveExistingProducts
action above the CostFinalize
action.
I know the documentation on MSDN recommends placing the RemoveExistingProducts
afterInstallValidate
, and I'm not sure if putting it before the InstallValidate
action has any negative side effects for minor upgrades, but we have decided to only perform major upgrades for our products so this solution appears to work for us.
Best Answer
Finally I found a solution - I'm posting it here for other people who might have the same problem (all 5 of you):
Under product add The following:
Under InstallExecuteSequence add:
From now on whenever I install the product it removed previous installed versions.
Note: replace upgrade Id with your own GUID