On linux, this was working in the past: nvprof python my_python_script.py
I just double checked and it work with the new back-end and the old back-end with this as an example: export THEANO_FLAGS=device=cuda ; nvprof python -c "import theano;v=theano.tensor.fvector();f=theano.function([v], v+1); f([1])" So the problem seem to be related that windows have different need for this. Maybe you need to modify Theano to call the function you named. But maybe it is simpler to install Linux? If you try to modify Theano, make sure to modify the new back-end (with device=cuda). We will get rid of the old one soon and it would be a waste of time. Frédéric On Mon, Mar 13, 2017 at 6:14 PM <[email protected]> wrote: > Hi there, > > I was wanting to use nvprof with theano code on windows command line. > > With CUDA code, I compile with: > > nvcc Test.cu -ccbin "C:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC" -o Test1 "C:\Program Files\NVIDIA GPU Computing > Toolkit\CUDA\v7.5\lib\x64\cuda.lib" "C:\Program Files\NVIDIA GPU Computing > Toolkit\CUDA\v7.5\lib\x64\cudart.lib" > > And then nvprof can be used: > > "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin\nvprof.exe" > Test1.exe > > Test1.cu has to have cudaProfilerStop() at the end of main, and have > #include cuda.h and #include cuda_profiler_api.h, and the linked libraries > in the compile stage. If it doesn't, nvprof doesn't output any profiling > information and gives a warning: Some profiling data are not recorded. Make > sure cudaProfilerStop() or cuProfilerStop() is called before application > exit to flush profile data. > > For a theano python code, I have a .theanorc file with: > [nvcc] > compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin > > [cuda] > root=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5. > > When I do: > > nvprof python theano_code.py > > The code runs but I don't get any profiling information and the same > warning about requiring cudaProfilerStop() to flush. So my question is what > function can I use in the theano code to achieve the same as > cudaProfilerStop() and what libraries would I need to link in the theanorc > file for the nvcc compile phase? From what I've seen/googled it seems like > nvprof should just work with the python/theano code and I've played around > a bit with editing the theanorc file but I can't get it to work! > > Anyone got any tips please? Would be much appreciated! > Thanks, > Jo > > -- > > --- > You received this message because you are subscribed to the Google Groups > "theano-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
