RuntimeError: CUDA error (10): invalid device ordinal

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/LEE18254290736/article/details/84650076

在运行cuda程序时发生报错,出现 RuntimeError: CUDA error (10): invalid device ordinal

造成这个错误的原因主要是本地只有一个 GPU (GPU:0),而程序中使用 GPUs:1。

在配置信息中,程序是1,我改成0就可以正常运行了。

猜你喜欢

转载自blog.csdn.net/LEE18254290736/article/details/84650076