avatarify-python icon indicating copy to clipboard operation
avatarify-python copied to clipboard

Error with run_windows.bat

Open virtualmonster opened this issue 6 years ago • 18 comments

RuntimeError: CUDA error: no kernel image is available for execution on the device

I have a Windows 10 machine with Nvidia GTX Titan card. Nvidia says it supports CUDA 3.5 which I think is the minimum required?

Also I read in the notes that it should fall to the CPU if the GPU isn't supported? How would I configure that if the card is the problem?

virtualmonster avatar Apr 19 '20 09:04 virtualmonster

One possible solution is to downgrade Pytorch

conda activate avatarify
conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch

This is a relative issue

alievk avatar Apr 19 '20 11:04 alievk

I had to downgrade Python to 3.7 at the same time... but now I'm seeing this error

(avatarify) c:\GIT_Repos\avatarify>run_windows.bat

(avatarify) c:\GIT_Repos\avatarify>REM Web-camera device id

(avatarify) c:\GIT_Repos\avatarify>set CAMID=0

(avatarify) c:\GIT_Repos\avatarify>REM ################################################

(avatarify) c:\GIT_Repos\avatarify>REM Normally you don't want to change settings below

(avatarify) c:\GIT_Repos\avatarify>REM Conda environment name

(avatarify) c:\GIT_Repos\avatarify>set CONDA_ENV_NAME=avatarify

(avatarify) c:\GIT_Repos\avatarify>REM @set /P CAMID="Pick the webcam id you want to use (typically "0"): " Traceback (most recent call last): File "cam_fomm.py", line 11, in import cv2 File "C:\Users\stuart\miniconda3\envs\avatarify\lib\site-packages\cv2_init_.py", line 5, in from .cv2 import * ModuleNotFoundError: No module named 'cv2.cv2'

virtualmonster avatar Apr 19 '20 12:04 virtualmonster

reinstalled a different version of python but I'm still ending up with CUDA error: no kernel image is available for execution on the device

Is there a way to force it not to use the GPU as you suggest in the readme?

virtualmonster avatar Apr 19 '20 12:04 virtualmonster

Before run, call

set CUDA_VISIBLE_DEVICES=''

I'm afraid you will be disappointed with the performance.

alievk avatar Apr 19 '20 17:04 alievk

yeah I get a similar issue like this:

csrss_2020-04-21_02-21-18

PATH:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;

or do I need to also set the CUDA path variables to:

CUDA_PATH_V10_2=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2

??

Any idea how to work around this?

E3V3A avatar Apr 21 '20 00:04 E3V3A

Something else is weird. the conda (base) is python 3.7, while the conda (avatarify) is using py3.8. Is that correct?

E3V3A avatar Apr 21 '20 00:04 E3V3A

Something else is weird. the conda (base) is python 3.7, while the conda (avatarify) is using py3.8. Is that correct?

It is correct

Cuda installation is under question. Looks like Pytorch has Cuda runtime with itself. You can try removing Cuda from your computer, install the latest nVidia driver and re-install avatarify.

alievk avatar Apr 21 '20 08:04 alievk

You can try removing Cuda from your computer, install the latest nVidia driver and re-install avatarify.

That's a no go because:

  • I use CUDA successfully with other apps
  • I already have the latest nVidia driver
  • avatarify works, but apparently without CUDA because of the error above.

My question is if downgrading pytorch would solve it. I still need to try that.

E3V3A avatar Apr 21 '20 13:04 E3V3A

What GPU you have?

alievk avatar Apr 21 '20 14:04 alievk

Building Pytoch from source may be an option.

alievk avatar Apr 21 '20 14:04 alievk

@alievk

What GPU you have?

An older one: GTX 850M

I also tried:

conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch

Which gave the following errors:

(base) D:\avatarify\avatarify\avatars>conda activate avatarify
(avatarify) D:\avatarify\avatarify\avatars>conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
    ...
        raise UnsatisfiableError({})
    conda.exceptions.UnsatisfiableError:
    Did not find conflicting dependencies. If you would like to know which
    packages conflict ensure that you have enabled unsatisfiable hints.

    conda config --set unsatisfiable_hints True

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    ...
    TypeError: sequence item 0: expected str instance, Channel found

E3V3A avatar Apr 21 '20 16:04 E3V3A

@alievk

What GPU you have?

An older one: GTX 850M

Usually CUDA works well on GTX Gen 10 and upper (1060,1070,1080,2060,2070,2080). Others graphics always shows errors. I don't know why but I tried CUDA on GT950 and fails.

pablodz avatar Apr 21 '20 19:04 pablodz

Before run, call

set CUDA_VISIBLE_DEVICES=''

I'm afraid you will be disappointed with the performance.

You were right of course... but I was glad to see it working at all. If I get access to a better graphics card than my GXT Titan then I'll give it another go sometime... or if you ever figure out a way to make it work on my card I'll also be keen to try it

Thanks @alievk

virtualmonster avatar Apr 21 '20 21:04 virtualmonster

set CUDA_VISIBLE_DEVICES=''

I tried that, and it totally killed my frame rate. But this is a good sign for me, because it proved that CUDA was actually working for me on my very old shitty graphics card or ??

Are there any better ways to check if CUDA is running?

E3V3A avatar Apr 21 '20 21:04 E3V3A

Are there any better ways to check if CUDA is running?

You can use nvidia-smi tool https://forums.developer.nvidia.com/t/nvidia-smi/59840/5

alievk avatar Apr 22 '20 08:04 alievk

c:
cd \Program Files\NVIDIA Corporation\NVSMI
nvidia-smi

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 442.19       Driver Version: 442.19       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 850M   WDDM  | 00000000:01:00.0 Off |                  N/A |
| N/A   62C    P8    N/A /  N/A |    100MiB /  4096MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+


E3V3A avatar Apr 22 '20 19:04 E3V3A

PS. I fixed this by fixing the cuda100 to cuda102 in the install script and making sure the windows system paths pointes to the right cuda locations. I think it was also fixable by copying the cudaart64_102.dll into the windows installed path of the "blahblah Program Files ../CUDA/balabla" directory.

E3V3A avatar Apr 24 '20 21:04 E3V3A

INVIDIA RTX 4070 , WINDOWS 11 , DRIVER TYPE DCH have already install drivers update and have also installed cuda

Traceback (most recent call last): File "afy/cam_fomm.py", line 316, in out = predictor.predict(frame) File "C:\Users\babli\avatarify\afy\predictor_local.py", line 102, in predict kp_norm = normalize_kp(kp_source=self.kp_source, kp_driving=kp_driving, File "C:\Users\babli\avatarify\afy\predictor_local.py", line 28, in normalize_kp jacobian_diff = torch.matmul(kp_driving['jacobian'], torch.inverse(kp_driving_initial['jacobian'])) RuntimeError: CUDA error: operation not supported when calling cusparseCreate(handle)

any help to fix RuntimeError: CUDA error: operation not supported when calling

mindmy111 avatar Aug 05 '24 12:08 mindmy111