cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sandyandr
Adept I

Strange behaviour of Device ID

Why Device ID changes each time I start my program?

To prepare the kernel for execution, my idea was to implement this simple method in a initialization section of my program:

IF the source file is available - (1) build the kernel from it and then save the result into a separate binary file for the later use

ELSE - (2) try to build it from a correspondent binary file (which is saved during any of previous successful launch of (1)).

The name of binary supposed to be something like [deviceid].bin but as I found out there is only cl_device_id's LSW is a constant - its MSW is different each time I launch my program. I could use only LSW, of'course, but I'm not sure is it long enough to be unique among all GPUs possibly installed (in any particular system). Could somebody suggest something sensible here?

0 Likes
1 Solution
Dithermaster
Adept I

The specification doesn't say these will be persistent across runs or reboots, or moving cards around in the system. Also, if the driver updates you don't want to re-use your binary.

You could name your binary after a hash of the device name, driver version, and some other things that you'd want to trigger a re-build.

View solution in original post

0 Likes
2 Replies
Dithermaster
Adept I

The specification doesn't say these will be persistent across runs or reboots, or moving cards around in the system. Also, if the driver updates you don't want to re-use your binary.

You could name your binary after a hash of the device name, driver version, and some other things that you'd want to trigger a re-build.

0 Likes

Now I take "devicename+memsize" as a filename. Your suggestions about driver version and hash are useful, thank you.

0 Likes