mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
558 stars 148 forks source link

Worker error: User specified autocast device_type must be 'cuda' or 'cpu' #80

Closed rayadaschn closed 9 months ago

rayadaschn commented 9 months ago

Oops! (ಥ_ಥ) When I start fooocus to draw, the terminal reports an error: "Worker error: User specified autocast device_type must be 'cuda' or 'cpu'."

Therefore, I think fooocus did not set the device number of cuda properly. However, when the program starts, there is output that the device configuration is correct: "Device: cuda:0 NVIDIA A40 : native"

Finally, I set the cuda device id: I fixed the cuda device in main.py and the problem was solved.

"os.environ['CUDA_VISIBLE_DEVICES'] = xxx "

Is there an easier way? T^T

konieshadow commented 9 months ago

You can also set CUDA_VISIBLE_DEVICES in environment variable.

rayadaschn commented 9 months ago

You can also set CUDA_VISIBLE_DEVICES in environment variable.

Thx. (๑•̀ㅂ•́)و✧