yoyohonyang / LearingFaceAgeProgression

Learning Face Age Progression: A Pyramid Architecture of GANs, CVPR 2018
74 stars 14 forks source link

cuda runtime error (invalid device ordinal)? #4

Open peacherwu opened 5 years ago

peacherwu commented 5 years ago

As I ran torch script th test_aging.lua, I came across the following error:

THCudaCheck FAIL file=/home/peacherwuengr/torch/extra/cutorch/init.c line=734 error=101 : invalid device ordinal
/home/peacherwuengr/torch/install/bin/luajit: ./FaceAging/utils.lua:18: cuda runtime error (101) : invalid device ordinal at /home/peacherwuengr/torch/extra/cutorch/init.c:734
stack traceback:
        [C]: in function 'setDevice'
        ./FaceAging/utils.lua:18: in function 'setup_gpu'
        test_aging.lua:42: in function 'main'
        test_aging.lua:81: in main chunk
        [C]: in function 'dofile'
        ...engr/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x00405d50

Yet, the device code is indeed 1 as I checked:

th> cutorch.getDevice()
1

My cuda version:

$ nvidia-smi
Sat Mar 16 00:51:08 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.39       Driver Version: 418.39       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla P100-PCIE...  Off  | 00000000:00:04.0 Off |                    0 |
| N/A   36C    P0    27W / 250W |     82MiB / 16280MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
peacherwu commented 5 years ago

Weido, I use option -gpu 0 and it worked! Ignore me...