8

I have installed cuda 7 toolkit with newest driver, and it passed all the tests, it seems that driver is loaded, but every time when I just put my laptop to sleep, and wake it up from sleep, cuda doesn't work anymore, deviceQuery

./deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL

2 Answers 2

8

http://forums.fast.ai/t/cuda-lib-not-working-after-suspend-on-ubuntu-16-04/3546/4

You can reload the nvidia kernel module and it will work fine:

sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm

Notice though that this won't work unless all applications using that module are closed.

1
  • 1
    This solved my problem! I'm running with a Quadro K2100M on fedora28. Before trying this, I tried "sudo /usr/bin/nvidia-smi -pm ENABLED; sudo /usr/bin/nvidia-smi -c EXCLUSIVE_PROCESS" without success. I've always had to reboot in the past.
    – Aaron Swan
    Nov 8, 2018 at 20:28
5

https://chuanwen.wordpress.com/2015/07/19/run-cuda-on-ubuntu-14-04-2/

What if cuda does not work after laptop wake up from sleep:

Put following 2 lines in your /etc/rc.local:

/usr/bin/nvidia-smi -pm ENABLED
/usr/bin/nvidia-smi -c EXCLUSIVE_PROCESS
3
  • Works like a charm! Thank you! (Mint Mate 18.1 - Nvidia GTX 770)
    – Peterling
    Apr 21, 2017 at 9:45
  • Does this prevent the problem from happening in the future? Setting these manually when cuda stopped functioning did not seem to resolve my issue. Thanks.
    – Aaron Swan
    Nov 8, 2018 at 20:32
  • This worked for me!! (Mint 18.3, Quadro M1200 with 384.130 driver and CUDA 9.0)
    – Florent F
    Jan 13, 2020 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.