Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AcceleratedAbstractGPU: Can't download file #5

Open
tinchodias opened this issue Dec 9, 2021 · 8 comments
Open

AcceleratedAbstractGPU: Can't download file #5

tinchodias opened this issue Dec 9, 2021 · 8 comments

Comments

@tinchodias
Copy link

Hi!

I get a loading error... I tried in Pharo 9 and 10 (MacBook from 2018):

Metacello new
   baseline: 'FormSceneGraph';
   repository: 'github://ronsaldo/form-scene-graph';
   load: #AcceleratedAbstractGPU.

There is this URI:
https://api.github.com/repos/ronsaldo/abstract-gpu/releases/assets/49144800
In the debugger that's shown.

During load I only get a visual popup with the download error that dissapears, but when I try to open the system preferences I get the debugger (apparently of the same error, didn't check).

I tried to debug or find a fix but failed.
For example, use variations of the parameters to the download sentence, but even rewriting it to use the Iceberg helper which should use my credentials*, but didn't succeed. And I didn't find an announcement from GitHub such a change in the REST API.

*:

		(IceGitHubAPI new
			acceptMediaType: 'application/octet-stream';
			get: downloadFileURI)

The stack in the debugger is:

PhaNAPIGitHubRelease(Object)>>error:
PhaNAPIGitHubRelease>>downloadAssetNamed:uri:
PhaNAPIGitHubRelease>>downloadUser:repository:release:forMode:platform:
PhaNAPIGitHubRelease>>fetchLibrary:fromUser:repository:release:
PhaNAPIGitHubRelease>>fetchLibrary:fromIcebergRepoOfClass:
PhaNAPIGitHubRelease class>>fetchLibrary:fromIcebergRepoOfClass:
AGPUCBindings(AGPUCBindingsBase)>>fetchLibrary
AGPUCBindings(PhaNAPILibrary)>>ffiLibraryName
AGPUCBindings(PhaNAPILibrary)>>libraryName
TFCalloutMethodBuilder(FFICalloutMethodBuilder)>>libraryName
TFCalloutMethodBuilder>>createFFICalloutLiteralFromSpec:
TFCalloutMethodBuilder>>generateFFICallout:spec:ffiLibrary:
[ :builder | | r |
		
		"Copy the properties of the old method"
		sender methodProperties
			ifNotNil: [ properties := sender methodProperties copy.
				properties method: nil.
				builder properties: properties ].

		builder
			numArgs: self argumentNames size;
			addTemps: (self argumentNames copyWith: #result).		
		
		ffiLibrary preMethodBuildContext: sender builder: builder spec: functionSpec.
		r := self generateFFICallout: builder spec: functionSpec ffiLibrary: ffiLibrary.
		ffiLibrary postMethodBuildContext: sender builder: builder spec: functionSpec.
		r] in TFCalloutMethodBuilder(FFICalloutMethodBuilder)>>generateMethodFromSpec: in Block: [ :builder | | r |...
IRBuilder class>>buildIR:
TFCalloutMethodBuilder(FFICalloutMethodBuilder)>>generateMethodFromSpec:
TFCalloutMethodBuilder(FFICalloutMethodBuilder)>>generate
TFCalloutMethodBuilder(FFICalloutMethodBuilder)>>build:
TFCalloutAPI(FFICalloutAPI)>>function:library:
TFCalloutAPI(FFICalloutAPI)>>function:module:
AGPUCBindings(FFILibrary)>>ffiCall:
AGPUCBindings>>getPlatforms_numplatforms:platforms:ret_numplatforms:
AGPU>>getPlatforms:platforms:ret_numplatforms:
[
		self getPlatforms: 0 platforms: nil ret_numplatforms: platformCount.
		^ platformCount unsignedLongAt: 1
	] in AGPU>>platformCount in Block: [...
FullBlockClosure(BlockClosure)>>ensure:
AGPU>>platformCount
AGPU>>fetchPlatforms
AGPU>>checkPlatformsSession
AGPU>>deviceDescriptions
AGPU class>>deviceDescriptions
AGPU class>>availableDeviceNames
@tinchodias
Copy link
Author

As the error is in AbstractGPU project, I googled it and tried the loading snippet from the README and there wasn't any error in that case:

Metacello new
   baseline: 'AbstractGPU';
   repository: 'github://ronsaldo/abstract-gpu/tonel';
   load

But didn't dig deeper

@ronsaldo
Copy link
Collaborator

ronsaldo commented Dec 9, 2021

This seems to be a Zinc error while following a redirect. The following snippet can be used for replicating the issue:

ZnClient new
	accept: 'application/octet-stream'; "Required by GitHub"
	url: 'https://api.github.com/repos/ronsaldo/abstract-gpu/releases/assets/49144132';
	followRedirects: true;
	downloadTo: 'agpu.tar.gz'

@ronsaldo
Copy link
Collaborator

ronsaldo commented Dec 9, 2021

I reported the issue on the Zinc bug tracker. See: svenvc/zinc#69

@Ducasse
Copy link
Collaborator

Ducasse commented Dec 10, 2021

Super!!!!. I reported the issue to the mailing-list!!!

@ronsaldo
Copy link
Collaborator

The workaround provided in the Zinc issue works, and I have integrated. This should now load properly by doing:

Metacello new
   baseline: 'FormSceneGraph';
   repository: 'github://ronsaldo/form-scene-graph';
   onConflictUseIncoming;
   load: #AcceleratedAbstractGPU.

I added the ZincHTTPComponents as a baseline dependency onto https://github.com/ronsaldo/phanapi, which is the utility that I made for automating the download of precompiled native libraries from GitHub release assets. Once the Zinc changes are backported onto Pharo 9, I will remove it from the baseline.

@tinchodias
Copy link
Author

Great. I loaded in a P100 and it works well after reopening the image.

@tinchodias
Copy link
Author

However, I had 2 warnings that I just continued:

ZincTestWarning

GLMWarning

@tinchodias
Copy link
Author

Should we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants