DEV Community

Arunanshu Biswas
Arunanshu Biswas

Posted on

Solve cuInit: CUDA_ERROR_UNKNOWN: unkown error

Steps

  1. Enable the following services in systemd:

    • nvidia-suspend.service
    • nvidia-resume.service
    • nvidia-hibernate.service

    Enable via sudo systemctl enable <service name>.

  2. Create a file named /etc/modprobe.d/nvidia-suspend.conf.

  3. Add the following line to the file:

    options nvidia NVreg_PreserveVideoMemoryAllocations=1
    
  4. Reboot

This shall prevent the cuInit: CUDA_ERROR_UNKNOWN: unknown error.

If that does not work

Execute the following:

sudo modprobe -r nvidia_uvm # or: sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm
Enter fullscreen mode Exit fullscreen mode

Read more about the problem here.

Top comments (0)