codeproject / CodeProject.AI-Server

CodeProject.AI Server is a self contained service that software developers can include in, and distribute with, their applications in order to augment their apps with the power of AI.
Other
636 stars 143 forks source link

GPU Not Being Used #26

Closed weswitt closed 1 year ago

weswitt commented 1 year ago

I just installed a GTX 1060 for use by AP.AI. I followed the instructions to install all the CUDA stuff. The dashboard reports that only the portrait filter is using the GPU. Is there a config step that I missed?

Your System: CodeProject.AI Server version: 1.6.7-Beta OS: Windows 10 System RAM: 32gb GPU: GTX 1060 GPU RAM: 6GB

image

weswitt commented 1 year ago

This might be relevant

image

weswitt commented 1 year ago

and the hardware info:

Name: Microsoft Remote Display Adapter

Accelerator Capabilities Adapter Compatibility Microsoft Adapter DAC Type Adapter RAM Availability 3 Capability Descriptions Caption Microsoft Remote Display Adapter Color Table Entries Config Manager Error Code 0 Config Manager User Config False Creation Class Name Win32_VideoController Current Bits Per Pixel 32 Current Horizontal Resolution 1920 Current Number Of Colors 4294967296 Current Number Of Columns 0 Current Number Of Rows 0 Current Refresh Rate 32 Current Scan Mode 4 Current Vertical Resolution 1200 Description Microsoft Remote Display Adapter Device ID VideoController1 Device Specific Pens Dither Type 0 Driver Date 20060621000000.000000-000 Driver Version 10.0.19041.2075 Error Cleared Error Description ICM Intent ICM Method Inf Filename rdpidd.inf Inf Section RdpIdd_Install.NT Install Date Installed Display Drivers Last Error Code Max Memory Supported Max Number Controlled Max Refresh Rate 32 Min Refresh Rate 32 Monochrome False Number Of Color Planes Number Of Video Pages PNP Device ID SWD\REMOTEDISPLAYENUM\RDPIDD_INDIRECTDISPLAY&SESSIONID_0002 Power Management Capabilities Power Management Supported Protocol Supported Reserved System Palette Entries Specification Version Status OK Status Info System Creation Class Name Win32_ComputerSystem System Palette Entries Time Of Last Reset Video Architecture 5 Video Memory Type 2 Video Mode Video Mode Description 1920 x 1200 x 4294967296 colors Video Processor

Name: Intel(R) UHD Graphics 630

Accelerator Capabilities Adapter Compatibility Intel Corporation Adapter DAC Type Internal Adapter RAM 1073741824 Availability 3 Capability Descriptions Caption Intel(R) UHD Graphics 630 Color Table Entries Config Manager Error Code 0 Config Manager User Config False Creation Class Name Win32_VideoController Current Bits Per Pixel 32 Current Horizontal Resolution 1920 Current Number Of Colors 4294967296 Current Number Of Columns 0 Current Number Of Rows 0 Current Refresh Rate 59 Current Scan Mode 4 Current Vertical Resolution 1200 Description Intel(R) UHD Graphics 630 Device ID VideoController2 Device Specific Pens Dither Type 0 Driver Date 20220719000000.000000-000 Driver Version 31.0.101.2111 Error Cleared Error Description ICM Intent ICM Method Inf Filename oem18.inf Inf Section iCML_w10_DS Install Date Installed Display Drivers C:\Windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_51f685305808e3a5\igdumdim64.dll,C:\Windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_51f685305808e3a5\igd10iumd64.dll,C:\Windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_51f685305808e3a5\igd10iumd64.dll,C:\Windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_51f685305808e3a5\igd12umd64.dll Last Error Code Max Memory Supported Max Number Controlled Max Refresh Rate 60 Min Refresh Rate 59 Monochrome False Number Of Color Planes Number Of Video Pages PNP Device ID PCI\VEN_8086&DEV_9BC5&SUBSYS_86941043&REV_05\3&11583659&0&10 Power Management Capabilities Power Management Supported Protocol Supported Reserved System Palette Entries Specification Version Status OK Status Info System Creation Class Name Win32_ComputerSystem System Palette Entries Time Of Last Reset Video Architecture 5 Video Memory Type 2 Video Mode Video Mode Description 1920 x 1200 x 4294967296 colors Video Processor Intel(R) UHD Graphics Family

Name: NVIDIA GeForce GTX 1060 6GB

NVIDIA-SMI Version 522.25 NVIDIA Driver Version 522.25 CUDA Tools Version 11.8

Accelerator Capabilities Adapter Compatibility NVIDIA Adapter DAC Type Integrated RAMDAC Adapter RAM -1048576 Availability 8 Capability Descriptions Caption NVIDIA GeForce GTX 1060 6GB Color Table Entries Config Manager Error Code 0 Config Manager User Config False Creation Class Name Win32_VideoController Current Bits Per Pixel Current Horizontal Resolution Current Number Of Colors Current Number Of Columns Current Number Of Rows Current Refresh Rate Current Scan Mode Current Vertical Resolution Description NVIDIA GeForce GTX 1060 6GB Device ID VideoController3 Device Specific Pens Dither Type Driver Date 20221006000000.000000-000 Driver Version 31.0.15.2225 Error Cleared Error Description ICM Intent ICM Method Inf Filename oem10.inf Inf Section Section024 Install Date Installed Display Drivers C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_1b5e80ff87b1f5c8\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_1b5e80ff87b1f5c8\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_1b5e80ff87b1f5c8\nvldumdx.dll,C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_1b5e80ff87b1f5c8\nvldumdx.dll Last Error Code Max Memory Supported Max Number Controlled Max Refresh Rate Min Refresh Rate Monochrome False Number Of Color Planes Number Of Video Pages PNP Device ID PCI\VEN_10DE&DEV_1C03&SUBSYS_61633842&REV_A1\4&38AB2860&0&0008 Power Management Capabilities Power Management Supported Protocol Supported Reserved System Palette Entries Specification Version Status OK Status Info System Creation Class Name Win32_ComputerSystem System Palette Entries Time Of Last Reset Video Architecture 5 Video Memory Type 2 Video Mode Video Mode Description Video Processor NVIDIA GeForce GTX 1060 6GB

MikeLud commented 1 year ago

It looks to be enabled, but try clicking on the three dots on the right side of the module then click on Half Precision then Disable. If that does not work then try Enable GPU

image

image

weswitt commented 1 year ago

no joy. that did not make it switch over to GPU.

weswitt commented 1 year ago

i cranked up the logging level. i see the following in the log. why would this be the case?

2022-10-21 12:25:35: Server: detect_adapter.py: use_CUDA: False in Server

weswitt commented 1 year ago

Is CUDA 11.7 required or will 11.8 work? I ask because 11.7 is no longer available so I installed 11.8. Wondering of this is a cause of the issue?

weswitt commented 1 year ago

Is CUDA 11.7 required or will 11.8 work? I ask because 11.7 is no longer available so I installed 11.8. Wondering of this is a cause of the issue?

OK, I found an archived 11.7.1 version of CUDA. Do I need to uninstall 11.8 and install 11.7.1?

MikeLud commented 1 year ago

11.8 might be the issue since the code was developed around 11.7 so go back one more version to 11.7 and uninstall 11.8

https://developer.nvidia.com/cuda-11-7-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local

weswitt commented 1 year ago

ok i uninstalled cuda 11.8 and installed 11.7. so now i'm certain that everything that is installed matches the required versions. yet object detection will not use the gpu. what can be done to diagnose this issue?

MikeLud commented 1 year ago

Might need @ChrisMaunder to look at this issue for you

weswitt commented 1 year ago

i seem to have solved this. i decided to start from scratch so i clean installed windows and everything else. viola! i now have the gpu processing for cp.ai. my processing times are WAY better now too.

i think that what happened is that with all the installing & uninstalling something got jacked up and the only way to fix it was to nuke the machine and start over.

MikeLud commented 1 year ago

@weswitt did you get it to work with CUDA 11.8 or 11.7?

weswitt commented 1 year ago

i used the documented 11.7 and associated dependencies.

weswitt commented 1 year ago

the other thing of note for others is to watch out for windows auto driver install dance. it will jack things up and install a newer nvidia display driver that uses 11.8. to avoid this after a clean windows install just unplug the network cable before booting and install the correct driver that uses 11.7 (you can download the driver package on another pc and shuttle it over using a usb thumb drive).

ChrisMaunder commented 1 year ago

We'll see what we can do about warning about this and/or adapting to 11.8. Our system needs to work with whatever everyone has installed.

Thanks for being patient with this.

weswitt commented 1 year ago

no problem at all. i'm just happy that i got it working. thanks for the work on this project.

MikeLud commented 1 year ago

@ChrisMaunder I am seeing another user have issues getting CUDA to work with CUDA 11.8. You may want to update the link for CUDA 11.7 to the below link until you workout the bugs with CUDA11.8

https://developer.nvidia.com/cuda-11-7-0-download-archive image

weswitt commented 1 year ago

that is a great ides, but it's a bit more nuanced than that. downloading the right video card driver (what is labeled here as "CUDA 11.7 Drivers", is a bit tricky. when you go to the nvidia download site you are not obviously told the CUDA version used by the drivers. you have to dig in and read the release notes pdf. and the current driver package uses 11.8 so again you need to find the archive page for the drivers and then read the release notes for each archived package until you find the latest one that uses CUDA 11.7. kind of a PITA.

ChrisMaunder commented 1 year ago

Thanks for that. I've updated the text in the article to be more accurate and provided a link to the "old" versions.

We'll have to test and update the code to work with 11.8.

I thought point releases were meant to be backwards compatible. 🙄