cudaGetDevice() failed. Status: initialization error

The Extraction process failing on you, and you aren't getting an error back with clear instructions? Tell us about it here

Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Extraction process. If you want to get tips, or better understand the Extract process, then you should look in the Extract Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Post Reply
User avatar
Posts: 1
Joined: Wed Nov 23, 2022 12:11 am

cudaGetDevice() failed. Status: initialization error

Post by Copula »

Hi, I have this trouble. Can you please help with this?

Code: Select all

Initializing: MTCNN: (model_path: '['C:\\Users\\faceswap\\.fs_cache\\mtcnn_det_v2.1.h5', 'C:\\Users\\faceswap\\.fs_cache\\mtcnn_det_v2.2.h5', 'C:\\Users\\faceswap\\.fs_cache\\mtcnn_det_v2.3.h5']', allow_growth: False, exclude_gpus: None, input_size: 640, minsize: 20, threshold: [0.6, 0.7, 0.7], factor: 0.709)
Traceback (most recent call last):
  File "C:\Users\faceswap\lib\cli\", line 217, in execute_script
  File "C:\Users\faceswap\scripts\", line 165, in process
  File "C:\Users\faceswap\scripts\", line 689, in process
  File "C:\Users\faceswap\scripts\", line 709, in _run_extraction
  File "C:\Users\faceswap\plugins\extract\", line 272, in launch
  File "C:\Users\faceswap\plugins\extract\", line 701, in _launch_plugin
  File "C:\Users\faceswap\plugins\extract\", line 482, in initialize
  File "C:\Users\faceswap\plugins\extract\detect\", line 68, in init_model
    self.model = MTCNN(self.model_path,
  File "C:\Users\faceswap\plugins\extract\detect\", line 646, in __init__
    self._pnet = PNet(model_path[0],
  File "C:\Users\faceswap\plugins\extract\detect\", line 176, in __init__
  File "C:\Users\faceswap\lib\model\", line 70, in __init__
    self._context = self._set_session(allow_growth,
  File "C:\Users\faceswap\lib\model\", line 187, in _set_session
    retval = tf.device("/device:cpu:0")
  File "C:\Users\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\framework\", line 5510, in device_v2
    return device(device_name)
  File "C:\Users\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\framework\", line 5459, in device
    return context.device(device_name_or_function)
  File "C:\Users\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\eager\", line 2343, in device
  File "C:\Users\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\eager\", line 2138, in ensure_initialized
  File "C:\Users\MiniConda3\envs\faceswap\lib\site-packages\tensorflow\python\eager\", line 611, in ensure_initialized
    context_handle = pywrap_tfe.TFE_NewContext(opts)
tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed. Status: initialization error

============ System Information ============
encoding:            cp936
git_branch:          master
git_commits:         ffe8f9a Merge branch 'staging'
gpu_cuda:            No global version found. Check Conda packages for Conda Cuda
gpu_cudnn:           No global version found. Check Conda packages for Conda cuDNN
gpu_devices:         GPU_0: GeForce GTX 1060
gpu_devices_active:  GPU_0
gpu_driver:          418.81
gpu_vram:            GPU_0: 6144MB
User avatar
Posts: 2112
Joined: Fri Jul 12, 2019 12:53 am
Answers: 140
Has thanked: 101 times
Been thanked: 476 times

Re: cudaGetDevice() failed. Status: initialization error

Post by torzdf »

This is not enough information to diagnose your issue.


My word is final

Post Reply