• JP Lee

Executing to external GPU How to force control inside of Unity GPU light mapper.

We have Two steps.

1. Check your log file. 먼저 로그 파일을 확인 해야 합니다.

检查“Log”文件。

Go to C:\Users\'your user name'\AppData\Local\Unity\Editor 해당 경로를 찾아 갑니다. 여기서 your user name 은 본인 계정 이름 입니다.

找到相应的路径,在这里your user name是本人账户的姓名

for example for me below. 제 경우는 아래와 같습니다.

C:\Users\leego\AppData\Local\Unity\Editor

2. Open to Editor-prev.log file. 경로를 찾아 가서 log 파일을 열어 보니다.

打开Editor-prev.log文件

Would be finding to '-- Listing OpenCL platforms(s) --' -- Listing OpenCL platforms(s) --를 검색 합니다.

我是以下情况 检索-- Listing OpenCL platforms(s) --

in my case below. 아래처럼 해당 log 라인을 찾았습니다.

像下面一样找到相应的Log Line


-- Listing OpenCL platforms(s) --

* OpenCL platform 0

PROFILE = FULL_PROFILE

VERSION = OpenCL 1.2 CUDA 10.2.120

NAME = NVIDIA CUDA

VENDOR = NVIDIA Corporation

EXTENSIONS = cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_nv_create_buffer

* OpenCL platform 1

PROFILE = FULL_PROFILE

VERSION = OpenCL 2.1

NAME = Intel(R) OpenCL

VENDOR = Intel(R) Corporation

EXTENSIONS = cl_intel_dx9_media_sharing cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_d3d11_sharing cl_khr_depth_images cl_khr_dx9_media_sharing cl_khr_fp64 cl_khr_gl_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_spir

-- Listing OpenCL device(s) --

* OpenCL platform 0, device 0

DEVICE_TYPE = 4

DEVICE_NAME = GeForce RTX 2080 with Max-Q Design

DEVICE_VENDOR = NVIDIA Corporation

DEVICE_VERSION = OpenCL 1.2 CUDA

DRIVER_VERSION = 430.86

DEVICE_MAX_COMPUTE_UNITS = 46

DEVICE_MAX_CLOCK_FREQUENCY = 1230

CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 65536

CL_DEVICE_HOST_UNIFIED_MEMORY = false

CL_DEVICE_MAX_MEM_ALLOC_SIZE = 2147483648

DEVICE_GLOBAL_MEM_SIZE = 8589934592

DEVICE_EXTENSIONS = cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_copy_opts cl_nv_create_buffer

* OpenCL platform 1, device 0

DEVICE_TYPE = 4

DEVICE_NAME = Intel(R) UHD Graphics 630

DEVICE_VENDOR = Intel(R) Corporation

DEVICE_VERSION = OpenCL 2.1 NEO

DRIVER_VERSION = 25.20.100.6471

DEVICE_MAX_COMPUTE_UNITS = 24

DEVICE_MAX_CLOCK_FREQUENCY = 1150

CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 4294959104

CL_DEVICE_HOST_UNIFIED_MEMORY = true

CL_DEVICE_MAX_MEM_ALLOC_SIZE = 4294959104

DEVICE_GLOBAL_MEM_SIZE = 13677588480

DEVICE_EXTENSIONS = cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_depth_images cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_intel_subgroups cl_intel_required_subgroup_size cl_intel_subgroups_short cl_khr_spir cl_intel_accelerator cl_intel_media_block_io cl_intel_driver_diagnostics cl_intel_device_side_avc_motion_estimation cl_khr_priority_hints cl_khr_throttle_hints cl_khr_create_command_queue cl_khr_fp64 cl_khr_subgroups cl_khr_il_program cl_khr_mipmap_image cl_khr_mipmap_image_writes cl_intel_planar_yuv cl_intel_packed_yuv cl_intel_motion_estimation cl_intel_advanced_motion_estimation cl_khr_gl_sharing cl_khr_gl_depth_images cl_khr_gl_event cl_khr_gl_msaa_sharing cl_intel_dx9_media_sharing cl_khr_dx9_media_sharing cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_intel_d3d11_nv12_media_sharing cl_intel_simultaneous_sharing

* OpenCL platform 1, device 1

DEVICE_TYPE = 2

DEVICE_NAME = Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz

DEVICE_VENDOR = Intel(R) Corporation

DEVICE_VERSION = OpenCL 2.1 (Build 0)

DRIVER_VERSION = 7.6.0.0

DEVICE_MAX_COMPUTE_UNITS = 12

DEVICE_MAX_CLOCK_FREQUENCY = 2600

CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 131072

CL_DEVICE_HOST_UNIFIED_MEMORY = true

CL_DEVICE_MAX_MEM_ALLOC_SIZE = 8548493312

DEVICE_GLOBAL_MEM_SIZE = 34193973248

DEVICE_EXTENSIONS = cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_dx9_media_sharing cl_intel_dx9_media_sharing cl_khr_d3d11_sharing cl_khr_gl_sharing cl_khr_fp64 cl_khr_image2d_from_buffer cl_intel_vec_len_hint

-- GPU Progressive lightmapper will use OpenCL device 'Intel(R) UHD Graphics 630' from 'Intel(R) Corporation'--


And check to nvidia device like below log 파일에서 외장 GPU 에 대한 정보를 찾습니다.

然后在Log文件里面找到移动GPU的信息

-- Listing OpenCL device(s) -- * OpenCL platform 0, device 0 DEVICE_TYPE = 4 DEVICE_NAME = GeForce RTX 2080 with Max-Q Design

Select device via command line to Unity.exe "-OpenCL-PlatformAndDeviceIndices" platform device 명령어에 이런 형태의 명령어를 추가 하여 실행 해야 합니다.

命令语句里面要像这样添加这种形态的命令语句然后运行

And replacing to platform index with device index as 0 and 0. 저 같은 경우 Platform 과 device 모두 Index가 0 입니다.

我的情况就是 Platform和device的Index都是 0

How to create own your custom batch file. 매번 명령어를 입력 하여 유니티를 실행 사키는 것이 귀찮기 때문에 batch 파일을 하나 만듭니다.

每次输入命令语句运行Unity的话太麻烦了,所以会做一个Batch文件


1. Create new tex file then change to .txt to .bat ( Any name is all fine When you create new bat file.) 텍스트 파일을 하나 만들고 포멧을 bat 로 변경 합니다. 파일 이름은 아무거나 상관 없다.

做一个txt文件,格式变为bat,然后文件名随便设置一个

2. Type to like below. bat 파일을 열고 아래 코드를 입력 하고 저장 합니다.

打开bat文件输入一下代码后保存



3. Save file.

My case here.



Launch directly use this bat file to unity3D launching. bat 파일로 실행 하고 GPU Progressive light map 기능이 외장 GPU 를 잘 사용 하는지 확인 합니다.

运行bat文件确认GPU Progressive light map 功能是否能在移动GPU内顺利使用



Evantually We could avoiding to Nvidia Optimus function with directly excution to RTX GPU.

조회 0회

© 2014 by LEEGOONZ HOME.